|
|
I have 25 images on one page. I want to use it's own popup web navigation bar for each image.
Return to Recent Questions
Q:
I have 25 icons (images) on one page. I want to use it's own popup web navigation bar for each image.
How and where do I define IDs number 2-24 ?
Obviously I now have the first web navigation bar working only.
Does each image need it's own "source_" file?
Also, where is it defined that the popup web navigation bar has ID 1 ?
A:
> Also, where is it defined that the popup web navigation bar has ID 1 ?
Each web navigation bar has ID. The ID's number starts with 0.
So, when you have several data files on your page you have such ID's:
<script type="text/javascript" language="JavaScript1.2" src="menu-top.js"></script> // ID - 0
<script type="text/javascript" language="JavaScript1.2" src="source_pop.js"></script> // ID - 1
<script type="text/javascript" language="JavaScript1.2" src="source_pop1.js"></script> // ID - 2
<script type="text/javascript" language="JavaScript1.2" src="source_pop2.js"></script> // ID - 3
<script type="text/javascript" language="JavaScript1.2" src="source_pop3.js"></script> // ID - 4
and so on.
> I have 25 icons (images) on one page. I want to use it's own popup web navigation bar for each image.
If you want to have different style for the popup menus (there color, item, text,
font and so on) you should create 25 different .js files with your
parameters. And call them from your page, for example:
<SCRIPT language=JavaScript1.2 src="source_pop.js" type=text/javascript></SCRIPT>
<SCRIPT language=JavaScript1.2 src="source_pop1.js" type=text/javascript></SCRIPT>
<SCRIPT language=JavaScript1.2 src="source_pop2.js" type=text/javascript></SCRIPT>
...
<SCRIPT language=JavaScript1.2 src="source_pop24.js" type=text/javascript></SCRIPT>
If you have different item text only you can use one .js file with web navigation bar parameters:
<SCRIPT language=JavaScript1.2 src="source_pop.js" type=text/javascript></SCRIPT>
But you should delete the following code:
var menuItems = [
["Next","testlink.htm"],
["Prev","testlink.htm"],
["Close","testlink.htm"],
];
dm_init();
and move it to the html page:
<body>
...
<SCRIPT language=JavaScript1.2 src="source_pop.js" type=text/javascript></SCRIPT>
<script type="text/javascript"> //first popup web navigation bar ID - 1
var menuItems = [
["Next","testlink.htm"],
["Prev","testlink.htm"],
["Close","testlink.htm"],
];
dm_init();
</SCRIPT>
<script type="text/javascript"> //second popup menu ID - 2
var menuItems = [
["Text","testlink.htm"],
["Text1","testlink.htm"],
["Text2","testlink.htm"],
];
dm_init();
</SCRIPT>
<script type="text/javascript"> //third popup menu ID - 3
var menuItems = [
["New_Text","testlink.htm"],
["New_Text1","testlink.htm"],
["New_Text2","testlink.htm"],
];
dm_init();
</SCRIPT>
...
<script type="text/javascript"> //twenty fourth popup menu ID - 3
var menuItems = [
["New","testlink.htm"],
["New","testlink.htm"],
["New","testlink.htm"],
];
dm_init();
</SCRIPT>
And specify OnClick events for your images:
<img src="testimage.gif" width=200 onClick="return dm_popup(1, 1000, event);" style="cursor: hand;">
<img src="testimage.gif" width=200 onClick="return dm_popup(2, 1000, event);" style="cursor: hand;">
<img src="testimage.gif" width=200 onClick="return dm_popup(3, 1000, event);" style="cursor: hand;">
...
<img src="testimage.gif" width=200 onClick="return dm_popup(24, 1000, event);" style="cursor: hand;">
...
</body>
Return to Recent Questions
Related:
- March 14, 2009 - How do I enable javascript on the new browser, so I can see my web navigation bar?
- March 31, 2009 - Is there any way can we display submenu items on mouse over in web navigation bar?
- May 05, 2009 - I'm wondering if you can use the ASP code within Item Link of the web navigation bar?
- May 22, 2009 - I would like to have links of web navigation bar to our website when javascript turned off.
- Jun 08, 2009 - Is it possible to call JScript functions from web navigation bar?
- Jun 26, 2009 - I'm looking for a web navigation bar system that can be placed in a table cell.
- Jul 13, 2009 - Flash in Firefox disappears behind the submenus of web navigation bar.
- Jul 30, 2009 - I need the cursor not to change when hovering over items which don't have links in web navigation bar
- Aug 16, 2009 - I cannot change the background color of the web navigation bar
- Sep 03, 2009 - I couldn't see web navigation bar on my website, but I saw it on my local machine.
- Sep 20, 2009 - Does web navigation bar works with JSP? How can I do that?
|