简体   繁体   English

Sidr Click Action Jquery

[英]Sidr Click Action Jquery

I am trying create a web page with sidr plugin & jquery. 我正在尝试使用sidr插件和jquery创建一个网页。 When someone click on a list item it will do something like saying which item is it. 当某人单击列表项时,它会执行类似说出哪个项的操作。 I've created a basic html file like: 我已经创建了一个基本的html文件,例如:

http://pastebin.com/hc4QyxW6 http://pastebin.com/hc4QyxW6

with calling jquery and sidr library as you can see. 可以看到调用jquery和sidr库。 My css file is the one provided by sidr. 我的css文件是sidr提供的文件。 When I click on the ones on body, no problem. 当我单击身上的那些时,没问题。 But when I click the items on the sidebar it jquery won't activates the click activity? 但是,当我单击侧栏上的项目时,jquery不会激活单击活动吗? How can I make the ones in sidebar work? 如何使侧边栏中的内容起作用? I am looking for a solution for 5 hours. 我正在寻找5个小时的解决方案。 Please help :D 请帮忙:D

Thank you. 谢谢。

Here is My file 这是我的档案

A few tips: your doctype is very old html5 is plainer and suited for jquery. 一些提示:您的doctype很老,html5更简单,适合jquery。 use this: 用这个:

<!doctype html>
<html>
</html>

secondly all of your css for jquery comes before the script to call jquery.and the script to actually use the jquery should be in the head of your document. 其次,所有用于jquery的css都在调用jquery的脚本之前。而实际使用jquery的脚本应位于文档的开头。 if you are using jquery and jquery ui jquery must be listed first or the ui wont work. 如果您使用的是jquery和jquery ui,则必须首先列出jquery,否则ui不会起作用。 after that you should be able to link everything with the id's (the #'s withnames). 之后,您应该能够将所有带有ID的内容(#的withnames)链接起来。 like this: 像这样:

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<style>

after that the javescript selectors ($document.ready function) or css id's ( #id_name {whatever-style :attribute;} ) get applied to what your want the to by id'ing them in the element you want them used in ( like div id="#demoheader" or div data-role="content" id "demoheader" or whatever.) i hope this helps. 之后,通过在要使用的元素中标识它们,将javescript选择器($ document.ready函数)或CSS id(#id_name {whatever-style:attribute;})应用于您想要的对象div id =“#demoheader”或div data-role =“ content” id“ demoheader”或其他任何东西。)我希望这会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM