Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > ช่วยทีคับจะแก้ให้คลิกเองและเอาเวลาเปลี่ยนออกแก้ไงคับ JaveScript



 

ช่วยทีคับจะแก้ให้คลิกเองและเอาเวลาเปลี่ยนออกแก้ไงคับ JaveScript

 



Topic : 112297



โพสกระทู้ ( 36 )
บทความ ( 0 )



สถานะออฟไลน์




Code (Java)
(function($){
  	$.fn.SimpleGallery = function(_config){

		var 	_config = $.extend({
			swapDuration: 3500,
			fadeOutDuration: 200,
			fadeInDuration: 500,
			activeItem : 0
		}, _config);
		
		function _view($item){

			var $SG = $('#SimpleGallery');
			var itemCount = $SG.find('li').length;
			var itemIndex = ($item.index() + 1);

			if((itemIndex+1) != _config.activeItem && !(_config.activeItem == 0 && itemIndex == itemCount)){
				_config.activeItem = itemIndex;
				if(_config.activeItem == itemCount){
					_config.activeItem = 0;
				}
				$SG.find('div')
					.stop() // Stop current effect
					.fadeTo(0, 1) // Reset image's opacity
					.fadeOut(_config.fadeOutDuration, function(){ // Start image's fade in for hide old image item
						$(this).find('img').attr('src',$item.find('a').attr('href')); // Set current image
						$(this).find('span').text($item.find('a').attr('title')); // Set current description
						$(this).fadeIn(_config.fadeInDuration); // Start image's fade out for show current image item
					});
			}
		}
		
		function _play(){
			_view($('#SimpleGallery').find('li').eq(_config.activeItem));
		}
		
		return this.each(function (){
			_play();
			var _interval = setInterval(_play, _config.swapDuration);
			$(this).find('li').hover(function(){
				if(_interval){
					clearInterval(_interval);
				}
				_interval = setInterval(_play, _config.swapDuration);
				$('#SimpleGallery').find('div').show();
				_view($(this));
			}).find('a').click(function(){return false;});
		});
  	}
})(jQuery);



จะแก้ให้เป็นแบบคลิกเลือกเอง และเอาเวลาเปลี่ยนออกคับ



Tag : Java, HTML/CSS, JavaScript, jQuery







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2014-11-02 23:16:10 By : nung2553 View : 632 Reply : 3
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

ลองภาพประกอบหน่อยครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-11-10 20:51:02 By : mr.win
 


 

No. 2



โพสกระทู้ ( 36 )
บทความ ( 0 )



สถานะออฟไลน์


https://www.thaicreate.com/community/simple-jquery-hover-image-gallery-v.2.0.html


เอามาจากตัวอย่างนี้คับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-11-11 00:07:59 By : nung2553
 

 

No. 3



โพสกระทู้ ( 535 )
บทความ ( 0 )



สถานะออฟไลน์


เอาอันนี้ไปทับ
Code (JavaScript)
    (function($){
        $.fn.SimpleGallery = function(_config){

            var _config = $.extend({
                swapDuration: 3500,
                fadeOutDuration: 200,
                fadeInDuration: 500,
                activeItem : 0
            }, _config);

            function _view($item){

                var $SG = $('#SimpleGallery');
                var itemCount = $SG.find('li').length;
                var itemIndex = ($item.index() + 1);

            /*    if((itemIndex+1) != _config.activeItem && !(_config.activeItem == 0 && itemIndex == itemCount)){
                    _config.activeItem = itemIndex;
                    if(_config.activeItem == itemCount){
                        _config.activeItem = 0;
                    }*/
                    $SG.find('div')
                        .stop() // Stop current effect
                        .fadeTo(0, 1) // Reset image's opacity
                        .fadeOut(_config.fadeOutDuration, function(){ // Start image's fade in for hide old image item
                            $(this).find('img').attr('src',$item.find('a').attr('href')); // Set current image
                            $(this).find('span').text($item.find('a').attr('title')); // Set current description
                            $(this).fadeIn(_config.fadeInDuration); // Start image's fade out for show current image item
                        });
                //}
            }

            function _play(){
                _view($('#SimpleGallery').find('li').eq(_config.activeItem));
            }

            return this.each(function (){
                _play();
                //var _interval = setInterval(_play, _config.swapDuration);
                $(this).find('li').hover(function(){
                   /* if(_interval){
                        clearInterval(_interval);
                    }
                    _interval = setInterval(_play, _config.swapDuration);*/
                    $('#SimpleGallery').find('div').show();
                    _view($(this))
                }).find('a').click(function(){return false;});
            });
        }
    })(jQuery);



ประวัติการแก้ไข
2014-11-11 08:58:34
2014-11-11 08:59:42
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-11-11 08:56:15 By : gaowteen
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ช่วยทีคับจะแก้ให้คลิกเองและเอาเวลาเปลี่ยนออกแก้ไงคับ JaveScript
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 03
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่