如何使用jquery mobile 1.4.2在html5中的ul属性中添加自定义图标 [英] How I can add custom icon in li attribute of ul in html5 using jquery mobile 1.4.2

查看:78
本文介绍了如何使用jquery mobile 1.4.2在html5中的ul属性中添加自定义图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在开发phonegap项目,我想在ul的li属性中添加自定义图标(在我的项目文件夹中)我尝试过,谷歌但是很困惑,并没有得到所需的输出。



有没有添加自定义图标的步骤?如果是,那么告诉我和任何可用的源代码,然后发布... ???



先进的Thanx ..

解决方案

你可以添加不带jQuery的自定义图标,它可以用css开发。



这是你查询的一些代码。



 <   ul  >  
< li > < a < span class =code-attribute> href = photo_gallery.html > 照片库< / a > < / li >
< li > < a href = download.html > 下载< / a > < / li >
< li > ; < a href = enquiry.html > 查询< / a > < / li >
< / ul >





个别图标有一些css技巧还有。

如果你需要每个li上的sepreate图标,那么你还需要创建另一个类。



 leftGreen   li  {
margin 0 5px 0 0px;
padding 2px 0 2px 30px;
背景 url(../ images / bullate.gif )no-repeat 0 7px;
border-bottom #FFFFFF 1px虚线;
}







Bellow css用于换另一个图标的新图标

 <   pre     lang   =   css >  .leftGreen li.new-icon {
margin: 0 5px 0 0px;
填充:2px 0 2px 30px;
background:url(../ images / new-bullate.gif)no-repeat 0 7px;
border-bottom:#FFFFFF 1px dashed;
} < / pre > < /跨度>


Hello everyone,

I am developing project in phonegap,I want to add custom icon (which is in my project folder) in li attribute of ul(Unorder list).I tried,google it but get confused and didnt getting required output.

Is there any steps to add custom icon ? If yes then tell me and any source code available then post too...???

Thanx in advanced..

解决方案

You can add custom icon without jQuery and it can be develop with css.

Here is some code for your query.

<ul>
     <li><a href="photo_gallery.html">Photo Gallery</a></li>
     <li><a href="download.html">Download</a></li>
     <li><a href="enquiry.html">Enquiry</a></li>
</ul>



There is a some css trick for individual icon as well.
If you need sepreate icon on each li then you have to create another class as well.

.leftGreen li {
margin: 0 5px 0 0px;
padding: 2px 0 2px 30px;
background: url(../images/bullate.gif) no-repeat 0 7px;
border-bottom: #FFFFFF 1px dashed;
}




Bellow css is for new icon as per another icon

<pre lang="css">.leftGreen li.new-icon {
margin: 0 5px 0 0px;
padding: 2px 0 2px 30px;
background: url(../images/new-bullate.gif) no-repeat 0 7px;
border-bottom: #FFFFFF 1px dashed;
}</pre>


这篇关于如何使用jquery mobile 1.4.2在html5中的ul属性中添加自定义图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆