Reply
Hide/Show Div + Image Swap
Old 10-31-2009, 09:40 AM Hide/Show Div + Image Swap
monkey's Avatar
Ultra Talker

Posts: 442
Trades: 0
I'm trying to replicate the effect of collapsing and expanding (hide/show) div tags on http://www.prophet.com/business/issues.html .

I can do the hide and show of the div tag no problem, however I can't for the life of me figure out how you get those arrows to change directions. I'd assume it was just a simple image replacement, but need a little help.
monkey is offline
Reply With Quote
View Public Profile Visit monkey's homepage!
 
 
When You Register, These Ads Go Away!
Old 10-31-2009, 10:04 AM Re: Hide/Show Div + Image Swap
chrishirst's Avatar
Super Moderator

Posts: 22,223
Location: Blackpool. UK
Trades: 0
changing the className of the element so the background image changes is the quickest method to implement (no lag in loading the image)
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-01-2009, 09:26 PM Re: Hide/Show Div + Image Swap
monkey's Avatar
Ultra Talker

Posts: 442
Trades: 0
I was thinking of doing a background image, but if you notice they still seem to let you click on the image to expand/collapse the div tag. Is there a way I can keep that functionality with the image while still hiding it in the background of a div?
monkey is offline
Reply With Quote
View Public Profile Visit monkey's homepage!
 
Old 11-01-2009, 09:31 PM Re: Hide/Show Div + Image Swap
webcosmo's Avatar
Ultra Talker

Posts: 267
Location: Boston, MA
Trades: 1
Quote:
Originally Posted by monkey View Post
I was thinking of doing a background image, but if you notice they still seem to let you click on the image to expand/collapse the div tag. Is there a way I can keep that functionality with the image while still hiding it in the background of a div?
on the same javascript function that expand and collapse divs you can also change the image for the arrow.

as chrishirst said, you can use css for these easily.
__________________
JOIN US * FAST GROWING WEBMASTER FORUM * JOIN US
Join the fun loving, helpful community of webmasters
Free Classified Ads
webcosmo is offline
Reply With Quote
View Public Profile Visit webcosmo's homepage!
 
Old 11-02-2009, 04:40 AM Re: Hide/Show Div + Image Swap
chrishirst's Avatar
Super Moderator

Posts: 22,223
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by monkey View Post
I was thinking of doing a background image, but if you notice they still seem to let you click on the image to expand/collapse the div tag. Is there a way I can keep that functionality with the image while still hiding it in the background of a div?
Yes! use the onclick event of the container
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Hide/Show Div + Image Swap
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.12135 seconds with 13 queries