本文介绍了主页面中的jquery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 hi 我使用vs 2012,我想在一个母版页中使用jquery停靠菜单我使用这个代码,我以3种方式运行它,我在我的代码中标记,但所有方式都没有用。我该怎么解决这个问题? <%@ Master 语言 = C# AutoEventWireup = true CodeBehind = Site1.master。 cs 继承 = m.Site1 %> < !DOCTYPE html > < html xmlns = http://www.w3.org/1999/xhtml lang = zh dir = ltr > < head runat = server > < title > 主页< / title > <! - ------ way1 --- --------- - > < ;% - < script type =text / javascriptsrc =〜/ dock / js / jquery.js>< /脚本> < script type =text / javascriptsrc =〜/ dock / js / interface.js>< / script> < link href =〜/ dock / css / style.css =stylesheettype =text / css/> - - %> <! - ------ way2 ------------ - > <% - < script type =text / javascriptsrc = ./dock/js/jquery.js\"></script> < script type =text / javascriptsrc =。/ dock / js / interface.js>< / script> < link href =./ dock / css / style.css =stylesheettype =text / css/> - - %> <! - ------ way3 ------------ - > < script type = text / javascript src =' <% = ResolveUrl( dock / js / jquery.js)%>' > < / script > < script type = text / javascript src =' <% = ResolveUrl( / dock / js / interface.js)%>' > < / 脚本 > < link href =' <% = ResolveUrl( dock / css / style.css)%>' rel = stylesheet type = text / css / > <! - -------- -------------- - > < / head > < body > < 表单 id = form1 runat = 服务器 > < asp:ContentPlaceHolder ID = ContentPlaceHolder1 runat = 服务器 > < / asp:ContentPlaceHolder > < 页脚 类 = art-footer clearfix > < div class = art -footer-inner > <! - 底部停靠 - > < div class = dock id = dock2 > < div class = dock-container2 > < a class = dock-item2 href = # > < span > 主页< / span > < img src = dock / images / home.png alt = home / > < / a > < a class = dock-item2 href = # > < ; span > 联系< / span > < img src = dock / images / email.png alt = contact / > < / a > < a class = dock-item2 href = # > < span > 投资组合< / span > < img src = dock / images / portfolio.png alt = portfolio / > < / a > < a class = dock-item2 href = # > < span > 音乐< / span > < img src = dock / images / music.png alt = music / > < / a > < a class = dock-item2 href = # > < span > 视频< / span > < img src = dock / images / video.png alt = video / > < / a > < a class = dock-item2 href = # > < span > 历史记录< / span > < img src = dock / images / history.png alt = history / > < / a > < a class = dock-item2 href = # > < span > 日历< / span > < img src = dock / images / calendar.png alt = calendar / > < / a > < a class = dock-item2 href = # > < span > 链接< / span > < img src = dock / images / link.png alt = li nks / > < / a > < a class = dock-item2 href = # > < span > RSS < / span > < img src = dock / images / rss.png alt = rss / > < / a > < a class = dock-item2 href = # > < span > RSS2 < / span > < ; img src = dock / images / rss2.png alt = rss / > < / a > < / div > < / div > <! - 停靠菜单JS选项 - > < script type = text / javascript > $( document )。ready( function (){ $('' #dock2').Fisheye( { maxWidth: 60 ,项目:' a', itemsText:' span',容器:' .dock-container2', itemWidth: 40 , proximity: 80 , alignment:' left', valign:' bottom', halign:' center' } )} ); < / script > < / div > < / footer > < / div > < / form > < / body > < / html > 解决方案 ( document )。ready( function (){ (' #dock2').Fisheye( { maxWidth: 60 ,项目:' a', itemsText:' span',容器:' 。dock-container2', itemWidth: 40 , near: 80 , alignment:' left', valign:' bottom', halign:' center' } )} ); < / script > < / div > < / footer > < / div > < / form > < / body > < / html > 如果你想添加下拉菜单 我有一个css样本菜单,我可以与你分享 鼠标悬停下拉菜单会显示 hiI use vs 2012 and i want use a jquery dock menu in a masterpage i use this code and i run it in 3 way i marked in my code but all ways did'nt work. how do i solve this?<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="m.Site1" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" lang="en" dir="ltr"><head runat="server"> <title>Home</title> <!--------way1--------------><%-- <script type="text/javascript" src="~/dock/js/jquery.js"></script> <script type="text/javascript" src="~/dock/js/interface.js"></script> <link href="~/dock/css/style.css" rel="stylesheet" type="text/css" />--%><!--------way2--------------><%-- <script type="text/javascript" src="./dock/js/jquery.js"></script> <script type="text/javascript" src="./dock/js/interface.js"></script> <link href="./dock/css/style.css" rel="stylesheet" type="text/css" />--%><!--------way3--------------> <script type="text/javascript" src='<%=ResolveUrl("dock/js/jquery.js") %>' ></script> <script type="text/javascript" src='<%=ResolveUrl("/dock/js/interface.js") %>' ></script> <link href='<%=ResolveUrl("dock/css/style.css") %>' rel="stylesheet" type="text/css" /> <!--------------------------></head><body><form id="form1" runat="server"> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder><footer class="art-footer clearfix"><div class="art-footer-inner"> <!--bottom dock --><div class="dock" id="dock2"> <div class="dock-container2"> <a class="dock-item2" href="#"><span>Home</span><img src="dock/images/home.png" alt="home" /></a> <a class="dock-item2" href="#"><span>Contact</span><img src="dock/images/email.png" alt="contact" /></a> <a class="dock-item2" href="#"><span>Portfolio</span><img src="dock/images/portfolio.png" alt="portfolio" /></a> <a class="dock-item2" href="#"><span>Music</span><img src="dock/images/music.png" alt="music" /></a> <a class="dock-item2" href="#"><span>Video</span><img src="dock/images/video.png" alt="video" /></a> <a class="dock-item2" href="#"><span>History</span><img src="dock/images/history.png" alt="history" /></a> <a class="dock-item2" href="#"><span>Calendar</span><img src="dock/images/calendar.png" alt="calendar" /></a> <a class="dock-item2" href="#"><span>Links</span><img src="dock/images/link.png" alt="links" /></a> <a class="dock-item2" href="#"><span>RSS</span><img src="dock/images/rss.png" alt="rss" /></a> <a class="dock-item2" href="#"><span>RSS2</span><img src="dock/images/rss2.png" alt="rss" /></a> </div></div><!--dock menu JS options --><script type="text/javascript">$(document).ready(function () {$('#dock2').Fisheye({maxWidth: 60,items: 'a',itemsText: 'span',container: '.dock-container2',itemWidth: 40,proximity: 80,alignment: 'left',valign: 'bottom',halign: 'center'})});</script></div></footer></div></form></body></html> 解决方案 (document).ready(function () {('#dock2').Fisheye({maxWidth: 60,items: 'a',itemsText: 'span',container: '.dock-container2',itemWidth: 40,proximity: 80,alignment: 'left',valign: 'bottom',halign: 'center'})});</script></div></footer></div></form></body></html>If you want to add drop down menuI have got one css sample menu, that i can share with youon mouse over drop down will display 这篇关于主页面中的jquery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-16 00:34