jQuery.noConflict() examples Nguồn http://jquerynoconflict.discoverproductivity.co.uk/noconflict.html
Script gốc:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2 /jquery.min.js"></script>
<script type='text/javascript'>
$(window).load(function(){
$(document).ready(function(){
$('#imgSmile').width(200);
$('#imgSmile').mouseover(function()
{
$(this).css("cursor","pointer");
$(this).animate({width: "500px"}, 'slow');
});
$('#imgSmile').mouseout(function()
{
$(this).animate({width: "200px"}, 'slow');
});
});
});
</script>
Script chỉnh sửa:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2 /jquery.min.js"></script>
<script type='text/javascript'>
var $j = jQuery.noConflict();
$j(window).load(function(){
$j(document).ready(function(){
$j('#imgSmile').width(200);
$j('#imgSmile').mouseover(function()
{
$j(this).css("cursor","pointer");
$j(this).animate({width: "500px"}, 'slow');
});
$j('#imgSmile').mouseout(function()
{
$j(this).animate({width: "200px"}, 'slow');
});
});
});
</script>
Nhận xét
Đăng nhận xét