开发者

combine jquery and jQuery(document).ready(function(){ in a single js file

开发者 https://www.devze.com 2023-03-13 18:21 出处:网络
I would like to ask, is it possible to combine the var $j = jQuery.noConflict(); jQuery(document).ready(function($) {

I would like to ask, is it possible to combine the

var $j = jQuery.noConflict();
jQuery(document).ready(function($) {
$j('#featured-products').jcarousel();
$j("a.group").prettyPhoto({animation_speed:'normal',theme:'pp_default',slideshow:3000, autoplay_slideshow: true});
    $j('#slider').cycle({
    fx: 'fade', 
    speed:  '1000',
        timeout: 3500,
    pager:  '#slidernav' 
    }); 
    $j("#slider").mouseover(function() {
            $j('#slider').cycle('pause');
    }).mouseout(function(){
            $j('#slider').cycle('resume');
    });
});

in the same js file [at the end] that is made up 开发者_StackOverflow社区of varied jquery plugins.

Would appreciate all the help of how to accomplish such.

With best regards

Fabian


At the end of the day... jQuery or not, plugin or not.. it's all just JavaScript. So you can throw every little bit of JavaScript in a single file and there shouldn't be any problems (except readability, maintainability, lack of separation of concerns, etc).

0

精彩评论

暂无评论...
验证码 换一张
取 消