Welcome Guest, Not a member yet? Register   Sign In
A few little HTML/CSS problems
#11

[eluser]Unknown[/eluser]
You'll want to visit here for help with JQuery UI Tabs, which it looks like your template is using: http://docs.jquery.com/UI/Tabs

The short of it is that you need to do one of two things:

Specify which one you'd like selected when you initialize the tabs:

$(".tabs > ul").tabs({ selected: 1 });

Or you can fire off the javascript somewhere else if you'd like:

$(".tabs > ul").tabs( 'select', 1);
#12

[eluser]Jakebert[/eluser]
Thanks for all the info guys, I'll try to figure it out!

EDIT: nevermind, I'm still confused. I think I get how jQuery works but...
Code:
<h3 class="tit">Options</h3>
   <div class="tabs box">
     <ul>
       <li><a href="#tab01"><span>List</span></a></li>
       <li><a href="#tab02"><span>Add</span></a></li>
       <li><a href="#tab03"><span>Edit</span></a></li>
     </ul>
   </div>
   &lt;!-- /tabs --&gt;
   &lt;!-- Tab01 --&gt;
   <div id="tab01">
     //Tab 1
   </div>
   &lt;!-- /tab01 --&gt;
   &lt;!-- Tab02 --&gt;
   <div id="tab02">
  //Tab 2 etc

Where do I put the "selected" class so that jQuery knows which one is selected? Because:
Code:
//FROM jQUERY
            // Selected tab
            // use "selected" option or try to retrieve:
            // 1. from fragment identifier in url
            // 2. from cookie
            // 3. from selected class attribute on <li>
jQuery already knows how to read "selected" right? So where do I put that attribute?


And while I annoy you all, one more question: my tabs are about halfway down the page, but whenever you switch to a different tab it jumps back to the top of the page. Is there a way to make the scroll bar lock or something?
#13

[eluser]andrewtheandroid[/eluser]
Quote:jQuery already knows how to read "selected" right? So where do I put that attribute?
sorry i can't help you more with the jquery as i don't know enough myself.

Quote:And while I annoy you all, one more question: my tabs are about halfway down the page, but whenever you switch to a different tab it jumps back to the top of the page. Is there a way to make the scroll bar lock or something?

I don't think you can lock the scroll bar.

The only way i can think of making the point where you want to appear on the screen is use an # anchor for that section and then make the jquery after it has performed its switching link to that particular anchor. eg. #members #login etc..

- I dont even know if this is possible but worth looking up i guess. But to be honest why would it be aproblem if the focus jumps to the top of the page since they do not want to see the old tab as they have requested to "switch" sections?




Theme © iAndrew 2016 - Forum software by © MyBB