-1

I have 10 links,which are point towards 10 divs with display:none,When I click one link it should make that div appear and the every div contains tabs.Writing tabs code for every div is space consuming and time taking.Is there any way to code less and accomplish the task?

<a href="#div1">click to see div 1</a>

<a href="#div2">click to see div 2</a>

<a href="#div3">click to see div 3</a>

<div id="div1" style="display:none;">

jquery ui-tabs code

</div>

<div id="div2" style="display:none;">

jquery ui-tabs code

</div>

<div id="div3" style="display:none;">

jquery ui-tabs code

</div>
lucifer
  • 110
  • 8
  • 3
    *Is there any way to code less and accomplish the task* : Yes, but we can't show you how without more details. – Denys Séguret Feb 05 '14 at 15:31
  • What have you tried thus far? (protip: copy your code here and provide a working example from a site like jsfiddle.net) – Brad Christie Feb 05 '14 at 15:31
  • You could try create snippets in your IDE for repetitive code. But it is probably only repetitive to that particular project so maybe you need to use PHP to generate the HTML through a function to avoid all that hand coding, it will definitely be less error prone. – Chris Rymer Feb 05 '14 at 15:37

1 Answers1

0

You could use tools like Jade, Hogan, etc. by allowing partials in order to implement a code-template.

vdenotaris
  • 13,297
  • 26
  • 81
  • 132