Ask Question Forum:
Model Library:2025-02-08 Updated:A.I. model is online for auto reply question page
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by smfmetro10
at 2024-07-25 11:29:41
Point:500 Replies:4 POST_ID:829108USER_ID:11607
Topic:
JavaScript;;
Hi,
I have a ul nav system for a contact page that works but i need to make the general tab in the active state when the url is contact/index.html.
This is what I have so far.
Thanks for the Help!
I have a ul nav system for a contact page that works but i need to make the general tab in the active state when the url is contact/index.html.
This is what I have so far.
Thanks for the Help!
<script type="text/javascript"> $(document).ready(function(){ $(".label_copy").hide(); // Hide all tab content divs by default $("a[href='"+location.hash+"']").closest("li").addClass("active"); $(location.hash).show(); $(".contact_nav ul li").click(function(){ //Fire the click event $(".contact_nav ul li").removeClass("active"); $(this).closest("li").addClass("active"); // Remove pre-highlighted link var activeTab = $("a",this).attr("href"); // Catch the click link $(".label_copy").hide(); // hide currently visible tab content div $(activeTab).fadeIn(); // show the target tab content div by matching clicked link. return false; //prevent page scrolling on tab click }); });</script><style>.contact_nav {text-align:left;margin-left:-30px;margin-top:5px;width:705px;}.contact_nav li{ display: inline-block; text-align: left; list-style-type:none; background-color:#417DBE; margin: 0px 6px 5px 0px; padding: 10px 15px 5px 5px; width:100px; height:75px; color:#FFF; -webkit-border-radius: 8px; -moz-border-radius: 8px; border-radius: 8px;}.contact_nav li:hover{ background-color:#CCC; height:75px; padding: 10px 15px 5px 5px;}.contact_nav li:hover a { color: #000; }.contact_nav li a{ text-decoration: none; color: #FFFFFF; font-family:Georgia, "Times New Roman", Times, serif; font-size: 20px; line-height:1.5em;}.contact_nav li.active {background-color:#ccc;color:#000000;}.contact_nav li.active a {color:#000000;}.contact_nav ul li {cursor:pointer}.label_copy {margin-left:25px;width:650px;}</style><div id="contact_nav" class="contact_nav" style="width:685px;"> <ul style="width:685px;"> <li id="6"><a href="#general">General Information</a></li> <li id="7"><a href="#member">Member Services</a></li> <li id="8"><a href="#patient">Patient Safety</a></li> <li id="10"><a href="#press">Press Inquiries</a></li> <li id="1"><a href="#web">Website Feedback</a></li> </ul> <div id="member" class="label_copy"> <p>Member info.</p> </div> <div id="web" class="label_copy"> <p>Web info</p> </div> <div id="general" class="label_copy"> <p>General info.</p> </div><div id="patient" class="label_copy"> <p>Patient info.</p> </div> <div id="press" class="label_copy"> <p>Press info</p> </div> </div> 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:30:31:32:33:34:35:36:37:38:39:40:41:42:43:44:45:46:47:48:49:50:51:52:53:54:55:56:57:58:59:60:61:62:63:64:65:66:67:68:69:70:71:72:73:74:75:76:77:78:79:80:81:82:83:84:85:86:87:88:89:90:91:92:93:94:95:96:97:98:99:
Expert: Gary replied at 2024-07-25 11:53:15
:o)
Author: smfmetro10 replied at 2024-07-25 11:52:09
Once again Gary you have saved me! I think I owe you one of those cans of Duff!!
Thanks again!
Thanks again!
Expert: duncanb7 replied at 2024-07-25 11:36:30
I have a ul nav system for a contact page that works but i need to make the general tab in the active state when the url is contact/index.html.
This is what I have so far.
This is what I have so far.
What is your question, could you write it more in detail and step by step for viewer ?
Please see attachment, no any console error from developer tools
Duncan
Accepted Solution
Expert: Gary replied at 2024-07-25 11:35:23
500 points EXCELLENT
<script type="text/javascript"> $(document).ready(function(){ $(".label_copy").hide(); // Hide all tab content divs by default lhash=location.hash if(lhash==""){ lhash="#general" } $("a[href='"+lhash+"']").closest("li").addClass("active"); $(lhash).show(); $(".contact_nav ul li").click(function(){ //Fire the click event $(".contact_nav ul li").removeClass("active"); $(this).closest("li").addClass("active"); // Remove pre-highlighted link var activeTab = $("a",this).attr("href"); // Catch the click link $(".label_copy").hide(); // hide currently visible tab content div $(activeTab).fadeIn(); // show the target tab content div by matching clicked link. return false; //prevent page scrolling on tab click }); });</script> 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22: