Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/374.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
帕辛<;html和javascript之间的href值_Javascript_Jquery_Css_Html - Fatal编程技术网

帕辛<;html和javascript之间的href值

帕辛<;html和javascript之间的href值,javascript,jquery,css,html,Javascript,Jquery,Css,Html,我正在使用html和javascript制作的幻灯片: 如果无法点击较大的图像,则幻灯片效果良好。它有属性,但如何使它们工作,因此当我单击图片将我发送到特定链接(我在href=“”中写入的链接)时 它从以下内容中获取值: <div class="es-carousel"> <ul> <li><a href="http://www.google.com"> <img src="images/cityPlaces_ima

我正在使用html和javascript制作的幻灯片:

如果无法点击较大的图像,则幻灯片效果良好。它有属性,但如何使它们工作,因此当我单击图片将我发送到特定链接(我在href=“”中写入的链接)时

它从以下内容中获取值:

<div class="es-carousel">
  <ul>
    <li><a href="http://www.google.com">
      <img src="images/cityPlaces_images/thumbs/1.jpg" data-large="images/cityPlaces_images/1.jpg" alt="image01"
           data-description="From off a hill whose concave womb reworded" />
    </a></li>

并在这个gallery.js中生成:

var $thumb    = $item.find('img'),
    largesrc  = $thumb.data('large'),
    title     = $thumb.data('description');

$('<img/>').load( function() {

    $rgGallery.find('div.rg-image').empty().append('<img src="' + largesrc + '"/>');

    if( title )
        $rgGallery.find('div.rg-caption').show().children('p').empty().text( title );
var$thumb=$item.find('img'),
largesrc=$thumb.data('large'),
title=$thumb.data('description');
$('');
如果(标题)
$rgGallery.find('div.rg-caption').show().children('p').empty().text(标题);

您可以尝试将与每个拇指关联的url作为
数据属性包含在元素上:

 <div class="es-carousel">
  <ul>
    <li><a href="#">
      <img src="images/cityPlaces_images/thumbs/1.jpg" data-large="images/cityPlaces_images/1.jpg" alt="image01"
           data-description="From off a hill whose concave womb reworded"
           data-url="http://google.co.uk"/>
    </a></li>

非常感谢您的快速回复。这解决了我的问题(我对HTML5不太熟悉)。。。
var $thumb    = $item.find('img'),
    largesrc  = $thumb.data('large'),
    title     = $thumb.data('description');
    url       = $thumb.data('url');

$('<img/>').load( function() {

    $rgGallery.find('div.rg-image').empty().append('<a href="' + url + '"><img src="' + largesrc + '"/></a>');

    if( title )
        $rgGallery.find('div.rg-caption').show().children('p').empty().text( title );