Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 导航到另一个页面,单击使用颜色框的图像_Jquery_Popup_Colorbox - Fatal编程技术网

Jquery 导航到另一个页面,单击使用颜色框的图像

Jquery 导航到另一个页面,单击使用颜色框的图像,jquery,popup,colorbox,Jquery,Popup,Colorbox,当使用Colorbox单击图像时,我似乎不知道如何将用户导航到另一个页面。感谢您的帮助,谢谢 这是我的代码-> <html> <head> <title>Pop up!</title> <link href="colorbox.css" rel="stylesheet"></link> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1

当使用Colorbox单击图像时,我似乎不知道如何将用户导航到另一个页面。感谢您的帮助,谢谢

这是我的代码->

<html>
<head>
    <title>Pop up!</title>
    <link href="colorbox.css" rel="stylesheet"></link>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script src="jquery.colorbox-min.js" type="text/javascript"></script>
<script type="text/javascript"> 
$(document).ready(function(){
    $.fn.colorbox({href:"Pop_up_Int.jpg", open:true});
});
</script>
</head>
<body>

</body>
</html>

我不确定你正在使用的颜色盒版本是否会起作用。最新版本有一个回调onComplete,您可以这样使用它:

$(document).ready(function(){
    var url = "http://www.passmark.com/images/monitortestscreenshot5.gif";
    $.colorbox({href:url, onComplete: function() {
        $('#colorbox img.cboxPhoto').wrap('<a href="'+url+'"></a>');
    }});
});

Fiddle:。

您不能将图像包装在锚元素中吗?您可以提供一个Fiddle吗?不,正如您所看到的,所有内容都在head标签中,并由colorbox处理。。也许我错过了什么。有什么想法吗在JSFIDLE中,您可以包含外部脚本。查看fiddle页面左侧的第二个选项卡。真的,不过,我只需要看看这里有什么颜色的盒子。虽然它没有在我的浏览器中显示,但它提供了它应有的功能!我用的是一个很旧的版本。谢谢