Go Back   Dynamic Drive Forums > DD Scripts > Dynamic Drive scripts help
Search Dynamic Drive Forums:

Reply
 
Thread Tools Search this Thread
  #1  
Old 08-08-2008, 01:30 AM
TheJoshMan's Avatar
TheJoshMan TheJoshMan is offline
Senior Coders
 
Join Date: Jan 2006
Location: Ft. Smith, AR
Posts: 796
Thanks: 57
Thanked 130 Times in 117 Posts
Default CSS Gallery Persistence?

1) Script Title: CSS Image Gallery

2) Script URL (on DD): http://www.dynamicdrive.com/style/cs...gallery/#thumb

3) Describe problem: Not a problem YET per se, just curious as to whether or not this could be implemented in such a way that each larger image and description would stay put once the thumbnail is clicked. Is it possible to make it so that once someone clicks the thumbnail the enlarged <span> containing the larger image and description would stay in place until another thumbnail was hovered over?

Just curious. Thanks.
__________________
--------------------------------------------------
Reviews, Interviews, Tutorials, and STUFF
--------------------------------------------------
Home of the SexyBookmarks WordPress plugin
Reply With Quote
  #2  
Old 08-08-2008, 02:04 AM
rangana's Avatar
rangana rangana is offline
Elite Coders
 
Join Date: Feb 2008
Location: Cebu City Philippines
Posts: 1,115
Thanks: 17
Thanked 267 Times in 265 Posts
Default

Apparently, there's no easy way to do this via CSS alone, but with JS, might be possible.
See post # 4 for possibility.

Last edited by rangana; 08-08-2008 at 02:19 AM.
Reply With Quote
The Following User Says Thank You to rangana For This Useful Post:
TheJoshMan (08-08-2008)
  #3  
Old 08-08-2008, 02:10 AM
TheJoshMan's Avatar
TheJoshMan TheJoshMan is offline
Senior Coders
 
Join Date: Jan 2006
Location: Ft. Smith, AR
Posts: 796
Thanks: 57
Thanked 130 Times in 117 Posts
Default

Oops! I guess I thanked too soon! LOL
Yes, I was quite expecting it to have to be done via javascript... I just wasn't quite sure how or IF it was actually possible.
__________________
--------------------------------------------------
Reviews, Interviews, Tutorials, and STUFF
--------------------------------------------------
Home of the SexyBookmarks WordPress plugin
Reply With Quote
  #4  
Old 08-08-2008, 02:19 AM
rangana's Avatar
rangana rangana is offline
Elite Coders
 
Join Date: Feb 2008
Location: Cebu City Philippines
Posts: 1,115
Thanks: 17
Thanked 267 Times in 265 Posts
Default

How about giving me a chance to give you these steps:
  • Try to add this element in your markup
    Code:
    <div id="hold"></div>
  • Add this in your CSS:
    Code:
    #hold{
    position: absolute;
    padding: 5px;
    left: 240px;
    color: black;
    text-decoration: none;
    z-index:10000;
    }
  • Have this script:
    Code:
    <script type="text/javascript">
    window.onload=function(){
    for(var i=0,a=document.getElementsByTagName('a');i<a.length;i++)
    	{
    	if(a[i].className=='thumbnail'){
    		a[i].onclick=function(){
    			var hold=document.getElementById('hold');
    			hold.innerHTML=this.getElementsByTagName('span')[0].innerHTML;
    			hold.style.background='lightyellow';
    			hold.style.border='1px dashed gray';
    			return false;
    			}
    		a[i].onmouseover=function(){
    		document.getElementById('hold').innerHTML='';
    		hold.style.background='none';
    		hold.style.border='0px';
    		}
    		}
    	}
    }
    </script>
  • and have some beer

See the mess.
Reply With Quote
The Following User Says Thank You to rangana For This Useful Post:
TheJoshMan (08-08-2008)
  #5  
Old 08-08-2008, 02:35 AM
TheJoshMan's Avatar
TheJoshMan TheJoshMan is offline
Senior Coders
 
Join Date: Jan 2006
Location: Ft. Smith, AR
Posts: 796
Thanks: 57
Thanked 130 Times in 117 Posts
Default

muy bueno senor... Very much appreciated. Works like a charm. Thank you very much.
__________________
--------------------------------------------------
Reviews, Interviews, Tutorials, and STUFF
--------------------------------------------------
Home of the SexyBookmarks WordPress plugin
Reply With Quote
  #6  
Old 11-10-2008, 08:07 AM
student101 student101 is offline
Regular Coders
 
Join Date: Feb 2008
Posts: 100
Thanks: 11
Thanked 0 Times in 0 Posts
Question

Quote:
Originally Posted by rangana View Post
How about giving me a chance to give you these steps:
This has helped, but need to change it back to the default when mouse-out or mouse-off.
Code:
If this was the contact us page then the default image would be ;
<div id="hold"><img src="img/contactus.jpg" /><br />Contact us.</div>
You mouse-over to see other images when you mouse-out it resets to the default image.
Do I add;
a[i].onmouseout=function(){

Is there a method to show the default image of that page?

Edit:
Solved with javascript;
==
function showIt(imgsrc){
document.getElementById('imgshow').src=imgsrc;
}

function hideIt(){
document.getElementById('imgshow').src="images/contact.jpg";
}
==

Thanks, cheers.

Last edited by student101; 11-10-2008 at 11:25 AM.
Reply With Quote
Reply

Bookmarks

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

Forum Jump


All times are GMT. The time now is 01:50 AM.

Home - Contact Us - Archives - Link to DD - Top 

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.