开发者

Fancy box is doing to the link directly

I have this js

$(".features_edit").fancybox({
    'width'             : '38%',
    'height'            : '40%',
    'autoScale'         : false,
    'transitionIn'      : 'none',
    'transitionOut'     : 'none',
    'type'              : 'iframe'
});

my html

 <li><a href="http://somthing.com/side/48/features/553/edit" class="features_edit">Apples</a></li>
 <li><a href="http://somthing.com/side/48/features/554/edit" class="features_edit">Oranges</a></li>
 <li><a href="http://somthing.com/side/48/features/555/edit" class="features_edit">Pears</a></li>

but when i click on the link it goes to the location rather then the lightbox any ideas

Ok here is more infomation

All the links are getting added my javascript so when i did this

$(".features_edit").click(func开发者_如何学编程tion(){
  console.log("testing");
});

nothing happened so maybe i need some sort of live or something to make it work any ideas


Could you post a more complete code sample? Are you getting any javascript errors? I've also seen this when not including the proper path to the fancybox plugin js files.


Make sure you're calling the $.fancybox after the document is ready.

For example:

jQuery(document).ready(function($){
$(".features_edit").fancybox({
    'width'             : '38%',
    'height'            : '40%',
    'autoScale'         : false,
    'transitionIn'      : 'none',
    'transitionOut'     : 'none',
    'type'              : 'iframe'
});
});


The documentation is linked below.
http://fancybox.net/howto

Here are some things to consider about Fancybox:

  1. Requires a valid doctype
  2. Requires jQuery and fancybox js files.
  3. Requires fancybox css file.

Additionally, your $(selector).fancybox({... statement must be inside a $(document).read(function{... statement.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜