开发者

Jquery colorbox problem

开发者 https://www.devze.com 2023-03-08 19:39 出处:网络
Here is some code: <script type=\"text/JavaScript\" src=\"@Url.Content(\"~/Scripts/cloud-zoom.1.0.2.js\")\"></script>

Here is some code:

    <script type="text/JavaScript" src="@Url.Content("~/Scripts/cloud-zoom.1.0.2.js")"></script> 
    <script type="text/JavaScript" src="@Url.Content("~/Scripts/jquery.colorbox.js")"></script>
    <script type="text/JavaScript" src="@Url.Content("~/Scripts/jquery.colorbox-min.js")"></script>
    <link href="@Url.Content("~/Content/colorbox.css")" rel="stylesheet" type="text/css" />

       <div id="large-image">
        <a  href='http://some-image'  class = 'color cloud-zoom'  id='zoom1' rel="adjustX: 10, adjustY:10">
            <img  src="http://some-image" />
        </a>
        <a  href='http://some-image2'  class = 'color cloud-zoom'  id='zoom1' rel="adjustX: 10, adjustY:10">
            <img  src="http://some-image2" />
        </a>
      </div>

As you may already have noticed i use in the same anchor both cloud- zoom and colorbox. Cloud-zoom works just fine but colorbox does not because of the cloud-zoom plugin.

For instance if i remove cloud-zoom from the class of <a> this code works fine

$('a.color').colorbox({ width: "75%", height: "85%"});

So due to the cloud-zoom plugin the above line does not work. I also tried:

 $('#large-image').click(function () {
    jQuery("a.color").colorbox({ width: "75%", height: 开发者_如何学编程"85%" });
     });

but neither this does not work..

Any ideas??


$mouseTrap.bind('click',this,function(event){
     $("#zoom").trigger("click");
});

add in zoom.js

$('#zoom').colorbox();
0

精彩评论

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

关注公众号