简体   繁体   中英

Issue in using Fancybox

I'm new to use fancybox. i added correct path to fancybox source files and i tried in both chrome and firefox, both console returns me error

ReferenceError: jQuery is not defined [Break On This Error]

}(window, document, jQuery));

jquery...ybox.js (line 2020) TypeError: $(...).fancybox is not a function [Break On This Error]

'type' : 'iframe'

and my code is

>

 $(document).ready(function() {
>       $("#iframe").fancybox({
>     'width'         : '75%',
>     'height'        : '75%',
>     'autoScale'     : false,
>     'transitionIn'  : 'none',
>     'transitionOut' : 'none',
>     'type'          : 'iframe' });    });

<a id="iframe" href="/cms/new.php">Submit</a>

can any one figure out my issue and give me solutions?

You are probably not linking to the appropriate fancybox source file(s). Make sure to include these exactly once in your head:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="/fancybox/jquery.fancybox-1.3.4.pack.js"></script>

See this question for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM