The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Another question on show/hide divs
bigginge
post Mar 22 2012, 09:51 AM
Post #1


Member
***

Group: Members
Posts: 37
Joined: 23-January 12
Member No.: 16,315



I solved an earlier question I had on this subject but is there anyway I can have the first div Here (2011) showing when the page loads?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 22 2012, 11:53 AM
Post #2


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 15,472
Joined: 9-August 06
Member No.: 6



QUOTE(bigginge @ Mar 22 2012, 03:51 PM) *

I solved an earlier question I had on this subject but is there anyway I can have the first div Here (2011) showing when the page loads?



Well, don't hide it to start with I guess. The DW script looks pretty hairy. And it's overkill. There's no need to show and hide when all you want to do is to switch one image to another.

Also, the value of an ID must begin with a letter. Some browsers may ignore you all numeric IDs.
http://htmlhelp.com/reference/html40/attrs.html#id


--------------------
"Never go to excess, but let moderation be your guide."
- Cicero

IPB Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
bigginge
post Mar 22 2012, 01:57 PM
Post #3


Member
***

Group: Members
Posts: 37
Joined: 23-January 12
Member No.: 16,315



Thank you for the advice on the IDs, I will sort that out.
I found a tut online which explained how to achieve what I did. Could you advise how to do it differently, or point me to a tutorial to explain it? I can see how show hide in Dreamweaver would do it, but I need the images to be in the same place, on top of each other as it were.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 22 2012, 04:02 PM
Post #4


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 15,472
Joined: 9-August 06
Member No.: 6



If you place the first image where you want it you can then use JavaScript to change the src of the IMG tag when the links are clicked instead of hiding and showing. I don't know if one method is more effective than the other, but it seems easier this way since it's only equally sized images involved.


--------------------
"Never go to excess, but let moderation be your guide."
- Cicero

IPB Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 30th September 2014 - 05:20 AM