在对html样式进行优化的时候,经常会用到Js/jquery进行一些跳转切换的样式,而我们常做的就是在Js/jquery代码中嵌url图片链接代码,以实现动态交互的页面效果。

如下图所示:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAywAAADCCAIAAAAkStGlAAAgAElEQVR4nO2dMa/0uHWG9bMMVjayP2DzA5JqQSBwn7TCwkitToWT1kAKdYbqjeAyaQcI1AVwmqm23fUuU0iiDslDjjRXM5q593kwwHc/iUNSlES985I6rBwAAAAAPJ3q7AoAAAAAfEUQYQAAAAAngAgDAAAAOAFEGAAAAMAJIMIAAAAATgARBgAAAHACiDAAAACAE0CEAQAAAJwAIgwAAADgBBBhAAAAACeACAMAAAA4AUQYAAAAwAkgwgAAAABOABEGAAAAcAKIMAAAAIATQIQBAAAAnAAiDAAAAOAEjhdhvXVVtXzswZmPTTZPWznTHFycpLeVx/bBdtOMDyy4UJE9B/z0ekoutqplo6X0tqrKFRwbU4V59F1Vddlcx8FUdWUve+sKAADwHI4WYb2rKld82n4se3u8sNvE2JiHSry9jI0xTW+fLasaU5ZSOmPTltTSmvnew7nYqjbNVd3XWxQYAAC8NEeKsMYID6ya1di80QYOWT95WpWr7PJH5eQDOMpq2mXDzL0a8zmk+mzNx7hRJs6UqyI9MOk/jY1ZNoyZb5immR2eKfEkYabd/ltTNj7NarT5AhLTa5zUkFBhc/7W13VVS0o9p03G2CnlXN/lK4HXNsa5FArQzTlFKokvrNk0xjS937OWLAuOmrog7xBhAADw4jzDCQvsK5Ggt64yzjbOTdpo0UmNWf+e0vsHdcEJS3dZIcsmCVgut0TeCRsTA2cdNhsbI3TDKH2kyMVadNn095RMZjw2RuqbJafeio1jYypRcqJXwi0+dW+nf9fq9b0QRsEQoOqEFerp3DRo2IYKW2ip3vr0kzBsRp9RUlZq/Y2DyQx0IsIAAODFOV+EjdH20ZnQnbLivztEWFITu4g5vdwy20VYmFLuLYuwRF7EzlPgVCl/FvMv1HPJYv16WPQNEVao57w/NKvGOA9f00h2JQm1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2tqzS4JSEAAAAA4N14Pyest3UVr1XIwnwAAADwZryZE+Z0EVaMsT4OBokGAAAAL8bncMJKCyQjwgAAAOAFeT8nzPVdVTEiCQAAAO/NZ3HCEGEAAADwVryfE7Z3OLI0XQwAAADgJD6JE5ZXWhebhrQAAAAAOJu3dMKSYcf8WGTfMUYJAAAAL8ibOWG9rRXHi2CtAAAA8G68nxMGAAAA8Al4MycMAAAA4HOAEwYAAABwAogwAAAAgBNAhAEAAACcACIMAAAA4AQOFmG9rSuCowIAAADc4ngnLLO2IwAAAACsIMIAAAAATgARBgAAAHACD5iY33dVhQ4DAAAAKIETBgAAAHACiDAAAACAE0CEAQAAAJzAQ0SYaa6HZwsAAADwmXhEsNauPzZTAAAAgE8HyxYBAAAAnAAiDAAAAOAEEGEAAAAAJ4AIAwAAADgBRBgAAADACSDCAAAAAE7g/wGXQL/PExk79QAAAABJRU5ErkJggg==" alt="" />

-------------------------------------------------------------------------------------------------------------------------------

问题:Js文件不认识__PUBLIC__这些thinkphp独特的链接,所以要我们自己重新定义url地址,才能使用这些路径。

     另外,定义url不能在Js文件里,必须在Js文件对应的index.html代码中写才有效果!一般将导入的js文件放在定义url地址的下面,这样可以不必担心引入Js文件的时候不能使用 定义的url路径。

解决办法:

第一步:在index.html页面中定义url路径

<script>
var url = "__PUBLIC__/Home";//定义js中的url路径
</script>
<script src="__PUBLIC__/Home/js/cy.js"></script>

第二步:引用定义好的url,这样即可完美在thinkphp中识别Js中的图片url路径

function figureAnimate(obj){
$figureImg.addClass('amimateZoom').animate({opacity:0,right:'-300px'},200,function(){
$figureImg.attr('src',url + '/img/'+obj.img).removeClass('amimateZoom')//单纯人物转换src地址
.animate({opacity:1,right:'-150px'},200); $('.readstar').attr('data-url',obj.url);
$figureText.html(obj.html);
$figureName.text(obj.name);
});
}

错误之处,还望指正!

ThinkPHP中关于JS文件如何添加类似__PUBLIC__图片路径的更多相关文章

  1. 在winform中调用js文件并输出结果

    在winform中调用js文件并输出结果默认分类 2007-10-19 16:35:06 阅读25 评论0 字号:大中小 由于项目需要在winform中调一个强大的js,所以把这个tip记录在此: 1 ...

  2. html或者jsp页面引用jar包中的js文件

    一,页面上引用jar包中的js文件的方法 使用java web框架AppFuse的时候发现,jquery.bootstrap等js框架都封装到jar包里面了.这些js文件通过一个wro4j的工具对其进 ...

  3. JS中关于JS文件的引用以及问题

    问题描述:          由于JSP中JS函数比较多,因此打算新建一个JS文件在JSP中引用JS文件,现在出现如下问题,JS如何引用时正确的,JS引用之后出现乱码如何解决? 问题解决: (1)JS ...

  4. eclipse中的js文件报错的解决办法

    在使用别人的项目的时候,导入到eclipse中发现js文件报错,解决办法是关闭eclipse的js校验功能. 三个步骤: 1. 右键点击项目->properties->Validation ...

  5. javascript中外部js文件取得自身完整路径得办法

    原文:javascript中外部js文件取得自身完整路径得办法 有时候我们需要引入一个外部js文件,这个js文件又需要用到自己的路径或者是所在的目录,别问怎么又这么变态的需求,开发做久了各种奇葩需求也 ...

  6. 1.在html中引入js文件和Jquery框架

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  7. eclipse中jquery.js文件有错误提示…

    eclipse中jquery.js文件有错误提示的解决办法 2013-04-06 19:18 浏览次数:382 由于jquery.js文件进行了压缩,压缩之后的语法eclipse无法完全识别,所以有错 ...

  8. 怎样下载网页中的js文件?

    1.按下F12,会看到调试的界面,如下图所示,先点击最上面的Resources选项,Frames--(你想下载的网址)--Script,下面就是全部的js文件啦,网站的图片啊什么的都可以下载了.

  9. Magento中调用JS文件的几种方法

    一.全局调用方法: 通过该方法每个页面都会引用这个JS文件,除非是类似jQuery这样的系统文件,不然不推荐这种方法. 文件路径:/app/design/frontend/default/Your_T ...

随机推荐

  1. 设置随处都可以调用tcc的编译环境

    tcc的短小精悍,编译速度快,以及独特的直接运行c代码功能,让tcc成为一个出色的编译器,横跨linux,windows平台. 笔者目前尚处于学习c(ANSI c/ISO c)阶段,为了加强手写代码的 ...

  2. 問題排查:建立選單時的錯誤 errcode:40016, errmsg:invalid button size hint: [RI68La0851vr18]

    可能原因: 1.如提示所說,第一層選單個數超過限制 (最多3個) 2.選單的 json 格式有誤,目前已知少了括弧會提示此錯誤

  3. Segmetation fault你来的真不是时候

    问题是这样的,今天一个简单的C程序,用gcc编译成汇编语言后,本来想在里面改点东西,结果运行时就报了"Segmetation fault".它丫来的还真不是时候,刚好最近正好烦它呢 ...

  4. 用sql从一张表更新数据到另外一张表(多表数据迁移)

    update TBL_1 A, TBL_2 B, TBL_3 Cset a.email=c.email_addrwhere a.user_id=b.user_id and b.un_id=c.un_i ...

  5. js获取文件大小

    var file = urlBox.doc.activeElement.files[0]||urlBox.files[0] ; if (file) { var fileSize = 0; if (fi ...

  6. 通过pycurl模块添加put和delete请求

    原文链接: http://anupamshakya.blogspot.com/2013/07/implementation-of-put-and-delete-in.html

  7. 实战录 | 基于openflow协议的抓包分析

    <实战录>导语 云端卫士<实战录>栏目定期会向粉丝朋友们分享一些在开发运维中的经验和技巧,希望对于关注我们的朋友有所裨益.本期分享人为云端卫士安全SDN工程师宋飞虎,将带来基于 ...

  8. JS基本语法

    1.JS嵌入网页的程序 2.解释型语言--用浏览器解释(必须需要浏览器),一开始是数据验证(编程语言) 7天开发 3.ECMA标准化 4.JS与JAVA没有任何关系 JS增加用户的交互 5.JS有常量 ...

  9. mysql中的高级查询

    以前学习的查询语法: select 字段名 from 表名 where 条件 其实,查询的语法变化很多: 1. select 可以查询表达式, 表达式就是 运算符+操作数. 比如 1 + 1 2 * ...

  10. Java 关键字、标识符、注释、常量与变量、数据类型,算术、赋值、比较、逻辑、位、三元运算符和流程控制、break、continue【3】

    若有不正之处,请多多谅解并欢迎批评指正,不甚感激.请尊重作者劳动成果: 本文原创作者:pipi-changing本文原创出处:http://www.cnblogs.com/pipi-changing/ ...