การใช้ jquery หลาย เวอรชั่นรวมกันอาจจะเจอ error Uncaught TypeError: $(…) เช่นการใช้ datepicker เนื่องจากบางครั้งเรา copy datepicker มาใช้แล้วมันเรียก jqeury version ที่มัน support แต่ดันมีการเรียนใช้ jqeury
Category: jQuery
Top Ten jQuery Plugin
credit : http://webtopten.wordpress.com/2012/10/23/top-ten-useful-jquery-plugins/ Hey are you a web Developer or a Web Designer, if yes then this Jquery plugins can be
jQuery Validate
ไฟล์ index.html ใส่ฟอร์ม <!doctype html> <html lang=”en”> <head> <script type=”text/javascript” src=”jquery-1.7.1.min.js”></script> <script type=”text/javascript” src=”myscript.js”></script> <script type=”text/javascript” src=”jquery.validate.min.js”></script> <script type=”text/javascript” src=”jQueryPlugin.js”></script>
jQuery สร้าง Plugin function ใช้เอง
/// <reference path=”jquery-1.7.1.min.js” /> (function ($) { //สร้างชื่อฟังชั่นไว้ใช้งานเอง $.fn.myhightlight = function () { return this.each(function(){ $(this).css(‘background-color’,’#aa0000′) }); } })(jQuery) เอาไปใช้กับไฟล์
jQuery Validation
http://bassistance.de/jquery-plugins/jquery-plugin-validation/
การทำ Web service ด้วย WCF + Restful + Json PART II
ต่อจากของเดิม http://kungtee.rmutp.ac.th/index.php/wcf-restful-json/ ต่อจากครั้งที่แล้วทำ table และปุ่ม <!doctype html> <html lang=”en”> <head> <script type=”text/javascript” src=”jquery-1.7.1.min.js”></script> <script type=”text/javascript” src=”myscript.js”></script> </head> <body> <input type=”text”
Login Panel
$(document).ready(function(){ $(‘#login a’).toggle(function(){ $(this) .addClass(‘active’) .next(‘from’) .animate({‘height’ : ‘show’},{ duration: ‘slow’, easing: ‘easeOutBounce’ }); },function(){ $(this) .removeClass(‘active’) .next(‘form’) .slideUp(); });
Multi level accordion
$(document).ready(function(){ $(‘#accordion > li ul’) .click(function(event){ event.stopPropagation(); }) .filter(‘ :not(:first)’) .hide(); $(‘#accordion > li,#accordion > li > ul > li’).click(function(){
Simple accordion menus
$(document).ready(function(){ $(‘#celebs ul > li ul’) .click(function(event){ event.stopPropagation(); }) .filter(‘ :not(:first)’) .hide(); $(‘#celebs ul > li’).click(function(event){ var selfClick=$(this).find(‘url:first’).is(‘visible’); if(!selfClick){ $(this)
