code works in JSFiddle but not browser

后端 未结 2 441
清酒与你
清酒与你 2021-01-26 12:39

I\'m trying to move a fixed div containing an image of an airplane to the right and fade to 0 as the page is scrolled down from the top.

site: http://wp.ccrcc.org

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-26 13:10

    The reason for this is how wordpress initialize jQuery. Have a look here: jQuery noConflict Wrappers. In "no-confict" mode, the $ shortcut is not available and the longer jQuery is used. The following construct is a timesaver:

    jQuery(document).ready(function($) {
        // Inside of this function, $() will work as an alias for jQuery()
        // and other libraries also using $ will not be accessible under this shortcut
    });
    

提交回复
热议问题