Wrox Programmer Forums
|
BOOK: Beginning JavaScript
This is the forum to discuss the Wrox book Beginning JavaScript by Paul Wilton; ISBN: 9780764544057
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 15th, 2005, 06:12 PM
Registered User
 
Join Date: Mar 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 13: IE_NN_Menus.htm

Hello,

I've tweaked this code by mocing the images from living inside layers to directly living inside a table cell.

I understand that the cells they live in have had their <TD> tags changed to <TD rollover rollout> so that when all the events within the document are captured and passed to the mouserollover and mouserollout functions, only those objects who have these rollover and rollout parameters will have their styles changed.

At the moment, the identification of theses special <TD> tags are not solely being identified. For every cell in any table at all within the scope of the document is changing.

I think their is an error within the For loop inside the create menu function that is behind the problems.

CAN ANY ONE HELP??

Thanks
[email protected]
UK


 
Old March 16th, 2005, 01:05 PM
Registered User
 
Join Date: Jan 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Instead of using the 'Rollover Rollout' (which I could not get to work either), I just used the class attribute within the <td> to allow a <style> to change the tables just with the class="value" assigned in the create table loop. Here is the code I used for the createTable and <style>:

for (rowCount = 0; rowCount < totalNoRows; rowCount++)
{
tableRowHTML = tableRowHTML + '<tr><td onmouseover="return td_over()" onmouseout="return td_out()"id="';
tableRowHTML = tableRowHTML + menuName + menuItems[rowCount][0];
tableRowHTML = tableRowHTML + '" onclick="goPage(\'' + menuItems[rowCount][1] + '\')"';
tableRowHTML = tableRowHTML + ' class="TDMenu">' + menuItems[rowCount][2] + '</td></tr>';
}

<style>
.TDMenu
{
   color:white;
   font-family:arial;
   font-size:70%;
   width:50%;
   cursor:hand;
}
</style>

Let me know if this helped,

Swiss

The Point of a Journey
Is not to Arrive...
Neil Peart - Rush (Prime Mover)
 
Old March 19th, 2005, 09:17 AM
Registered User
 
Join Date: Mar 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,

Thank you so much for your reply.
It was reasurring to know i had located where the error was.

My for loop is different to your for the first line.
you put:
tableRowHTML = tableRowHTML + '<tr><td onmouseover="return td_over()" onmouseout="return td_out()"id="';
tableRowHTML = tableRowHTML + menuName + menuItems[rowCount][0];

I understand in principle what you are doing but im having problem trying to work out my code to do the same.

where are the td_over() and td_out() fundctions come from - have you renamed your code?

I hope you dont mind my asking again.
Angela



[/quote]

Thanks mcange
(EMail me: [email protected])





Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload_image.htm Chapter 7 jeroen BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 September 3rd, 2009 11:53 AM
"../Chapter 6/XSLT/IE/Figure3.htm" - missing image mark4asp BOOK: Professional Ajax 2nd Edition ISBN: 978-0-470-10949-6 0 October 31st, 2007 08:12 AM
book.htm problem in chapter 04 50000 BOOK: Professional Ajax ISBN: 978-0-471-77778-6 5 May 16th, 2006 06:22 PM
Beg. Javascript 2nd Ed Ch 13: IE_NN_Menus.htm mcange HTML Code Clinic 0 March 15th, 2005 05:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.