
Originally Posted by
suv
Code:
By script content, do you mean the HTML for each "tabbed" content?
What I meant is the content inside the <script> tags, where you declare the function ddajaxtabs ans assign it to a new variable.
Is it possible somehow to move this part in the external javascript file so it can be called on mouse over or on click from the <a> tag.
This way we can avoid the problem with positioning the <script> tags, which as I said before, if you don't put the just before </body> the end of the body tag, they have no effect whatsoever.
I've tried to insert it elsewhere in the body but with no success.
If you mean the invocation code such as:
Code:
<script type="text/javascript">
var myflowers=new ddajaxtabs("flowertabs", "flowerdivcontainer")
myflowers.setpersist(true)
myflowers.setselectedClassTarget("link") //"link" or "linkparent"
myflowers.init(3000)
</script>
What you can do is have it run when the page fully loads. This makes it possible for you to place the above anywhere on the page (ie: HEAD section), instead of having to follow the HTML of the Tabs and Tab Contents. To do this, you'd modify the above to become:
Code:
<script type="text/javascript">
window.onload=function(){
var myflowers=new ddajaxtabs("flowertabs", "flowerdivcontainer")
myflowers.setpersist(true)
myflowers.setselectedClassTarget("link") //"link" or "linkparent"
myflowers.init(3000)
}
</script>
Note that the above doesn't take into account other scripts also running themselves window.onload, which if there are will fail.
Bookmarks