What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Javascript variable help[solved]

Javascript variable help[solved]
Author: Message:
QtanJ
Junior Member
**


Posts: 37
34 / Male / –
Joined: Nov 2005
O.P. Javascript variable help[solved]
I have a IPB forum v.2 and want a spoiler tag. Since I don't want to modify my IPB forum yet, I want to use custom bbcode. I've got this code, but don't have a clue of how I make a variable decide what id number every spoiler need.

code:
<script language="JavaScript" type="text/JavaScript">
<!--
function toggleVisibility(obj)
{
      var Value=Math.random()*57568745757456
     document
if (obj!=null)
{
if (document.getElementById)
{
var current = (document.getElementById(obj).style.display == 'block') ? 'none' : 'block';
document.getElementById(obj).style.display = current;
}
else if (document.all)
{
var current = (document.all[obj].style.display == 'block') ? 'none' : 'block'
document.all[obj].style.display = current;
}
}
}
//-->
</script>
<p>
<a href="javascript:toggleVisibility('Value')">Spoiler</a>
</p>

<div id='Value' style="display:none;">
<p style="background-color:FF0000;FONT-SIZE: 24pt;">
{content}
</p>
</div>

{content} is right, i've testen and that part works.

If I make it {option} then I can make something like this to get it work with more than one each page
code:
Spoiler for somethingunique:
What I want in spoiler

What's wrong with this solution is:
1. You have to write something unique after = in every spoler tag
2. If you quote you need to change the id of the spoiler if you don't want the second spoiler to be a remote control of the first one.


The random number don't have to be a random number multiplied with that numeber i chose there, but it needs to have many choices since i don't like remote controls.

To test if your solution works, just make a html file with two or more spoilers and check if the second one works and that it isn't a remote control.

As the code is now it should work once in each page since the id of every spoiler is value.


Thanks for every answer.

This post was edited on 02-19-2006 at 10:29 PM by QtanJ.
Linux > Windows
Opengl > DirectX
02-19-2006 08:12 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Javascript variable help[solved] - by QtanJ on 02-19-2006 at 08:12 PM
RE: Javascript variable help. - by ShawnZ on 02-19-2006 at 08:16 PM
RE: Javascript variable help. - by QtanJ on 02-19-2006 at 10:28 PM
RE: Javascript variable help[solved] - by -dt- on 02-20-2006 at 03:31 AM
RE: Javascript variable help[solved] - by QtanJ on 02-20-2006 at 01:58 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On