如何使用jQuery代码读取图像路径

时间:2015-10-27 08:09:59

标签: javascript jquery image cycle

基本上,我希望更改斜杠设计,如下所示(红框)。所以我决定把它改成图像而不是代码。

enter image description here更改为enter image description here

我是否知道如何将斜线'/'更改为图像路径 - &gt; <img src="<?php echo base_url(); ?>images/icons/slash.jpg" />使用以下代码?

 $('#counter').text((options.currSlide + 1) + '/' + (options.slideCount));

这是我错误的答案

$('#counter').text((options.currSlide + 1) + '<img src="<?php echo base_url(); ?>images/icons/slash.jpg" />' + (options.slideCount));
希望你们中的一些人可以给我一些建议。

如果您需要完整的代码,请点击此处:JSFiddle

1 个答案:

答案 0 :(得分:0)

您可以查看以下链接 - http://jsfiddle.net/Dhqdc/104/

从Jquery改变

$('#counter').text((options.currSlide + 1) + '/' + (options.slideCount));

$('#counter').html((options.currSlide + 1) + $(this).html() + (options.slideCount));

完成Css的更改(您可以根据需要进行更改)

.image-slides img{padding:10px;background-color:green}

.image-slides,#counter img{padding:1px;background-color:green}

更改html(根据您的需要更改)

<div class="image-slides">

<div class="image-slides" style="display:none">

我调整了一些css&amp; html更好地显示演示,但jquery更改是您正在寻找的。 我希望这就是你要找的东西。