HEX
Server: Apache/2
System: Linux sv1.freethailand.com 2.6.18-410.el5 #1 SMP Wed May 11 06:00:14 EDT 2016 x86_64
User: apache (101)
PHP: 5.3.29
Disabled: symlink,shell_exec,exec,proc_close,proc_open,popen,system,dl,passthru,escapeshellarg,escapeshellcmd,pcntl_exec,proc_get_status,proc_nice,proc_terminate,pclose,ini_alter,virtual,openlog,ini_restore
Upload Files
File: /home/pengthai/domains/pengthaicurry.com/public_html/js/script.js
	// JavaScript Document	

var leftPos, newWidth, $magicLine;

$("#example-one").append("<li id='magic-line'></li>");


$magicLine = $('#magic-line');
//$magicLine.width($('.active').width()).css('left', $('.active a').position().left).data('origLeft', $magicLine.position().left).data('origWidth', $magicLine.width());

var $thisLine = $('#example-one li.active');
//$magicLine.data('origLeft', $this.position().left).data('origWidth', $this.width());

$magicLine.data('origLeft', $thisLine.position().left+10).data('origWidth', $thisLine.width()-20);
$magicLine.css({
	"left": $magicLine.data('origLeft')+10,
	"width": $magicLine.data('origWidth')-20
});



/*$('#example-one li a').hover(function() {
	var $this = $(this);
	$this.parent().addClass('active').siblings().removeClass('active');
	$magicLine.data('origLeft', $this.position().left).data('origWidth', $this.parent().width());
	return false;
});
*/
/*Magicline hover animation*/
$('#example-one li').find('a.main-menu').hover(function() {
	var $thisBar = $(this);
	leftPos = $thisBar.position().left;
	newWidth = $thisBar.parent().width();
	$magicLine.css({
	"left": leftPos+25,
	"width": newWidth-50
});
}, function() {
	$magicLine.css({
	"left": $magicLine.data('origLeft')+10,
	"width": $magicLine.data('origWidth')-20
	});
});




		$('#navbarNav').on('show.bs.collapse', function () {
			$('.navbar-expand-lg').addClass('-collapse');
			$('.all-container').addClass('-collapse');
		})
		$('#navbarNav').on('hidden.bs.collapse', function () {
			$('.navbar-expand-lg').removeClass('-collapse');
			$('.all-container').removeClass('-collapse');
		})		

        $(document).ready(function(){
            $('#nav-icon3').click(function(){
                $(this).toggleClass('open');
            });
         });
		
       $(function() {
            window.sr = ScrollReveal();
            sr.reveal('.sr-icons', {
                duration: 600,
                scale: 0.3,
                distance: '0px'
            }, 200);
            window.scrollReveal = new scrollReveal();
        });

		var scrollTrigger = 0, /* ค่า scroll เริ่มต้น */
		
		/*ฟังก์ชั่น ทำให้ เมนูของ bootstrap(.navbar-default) เพิ่ม .slim เข้าไป เมื่อมีการ scroll เกินค่าที่ตั้งไว้*/
		scrollNavbar = function () {
			var scrollTop = $(window).scrollTop();
			if (scrollTop > scrollTrigger) {
				$('.headbar-main').addClass('slim');
			} else {
				$('.headbar-main').removeClass('slim');
			}
		};
		
		scrollNavbar(); // เรียกใช้ฟังก์ชั่น scrollNavbar เมื่อมีการเปิดหน้าเว็บ
		$(window).on('scroll', function () {  // เรียกใช้ฟังก์ชั่น 2 ตัวข้างใน เมื่อมีการ scroll
			scrollNavbar();
		});	
		
		$(window).scroll(function() {
            if($(this).scrollTop() != 0) {
             $('#back-to-top').fadeIn(); 
            } else {
             $('#back-to-top').fadeOut();
            }
	   });
		$('#back-to-top').click(function() {
			$('body,html').animate({scrollTop:0},700);
		});




        $(document).ready(function() {
            $(".fancybox").fancybox();
        });



/*/////////////////////////////////////////////////////////////////////////////////*/





	


/*var $el, leftPos, newWidth;

$("#example-one").append("<li id='magic-line'></li>");
var $magicLine = $("#magic-line");
$magicLine
.width($(".current_page_item").width())
.css("left", $(".current_page_item a").position().left)
.data("origLeft", $magicLine.position().left)
.data("origWidth", $magicLine.width());

$("#example-one li").find("a").hover(function(){
	$el = $(this);
	leftPos = $el.position().left;
	newWidth = $el.parent().width();
	$magicLine.stop().animate({
		left: leftPos,
		width: newWidth
	});
},function() {
	$magicLine.stop().animate({
		left: $magicLine.data("origLeft"),
		width: $magicLine.data("origWidth")
	});
});
*/