【问题标题】:How to read image path using jQuery code如何使用 jQuery 代码读取图像路径
【发布时间】:2015-10-27 08:09:58
【问题描述】:

基本上,我希望更改斜线设计,如下所示(红色框)。所以我决定将其更改为图像而不是代码。

改为

我可以知道如何使用以下代码将斜杠'/' 更改为图像路径 --> <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

【问题讨论】:

  • 你的问题根本不清楚,你能准确描述一下你想做什么。
  • 您好,我已经修改了我的问题,是否足够清楚?让我知道你不明白的部分。

标签: javascript jquery image cycle


【解决方案1】:

您好,请查看以下链接 - 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 和 html 以更好地展示演示,但 jquery 更改是您正在寻找的。 我希望这就是你要找的。​​p>

【讨论】:

  • 酷!但是我可以通过阅读另一个课程来更改为另一个图像吗?像这样 --> jsfiddle,但这是错误的代码。
猜你喜欢
  • 1970-01-01
  • 2011-10-23
  • 2012-09-23
  • 1970-01-01
  • 2011-10-07
  • 1970-01-01
  • 1970-01-01
  • 2015-08-07
  • 1970-01-01
相关资源
最近更新 更多