Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
CSS layout problem. I tried positioning variations still not working
Old 06-13-2011, 06:15 AM CSS layout problem. I tried positioning variations still not working
phazorRise's Avatar
Skilled Talker

Posts: 57
Name: Sachin Gutte
Trades: 0
I have wrote a code for an image gallery.
Code:
ul.gallery li {
float: left;
margin: 0 10px;
padding: 10px;
border: 1px solid #ddd;
list-style: none;
margin-bottom:10px;
}
ul.gallery li a img {
float: left;
width: 200px;
}
and here's the html code-
HTML Code:
<a href="#">Page 1</a> | <a href="#">Page 2</a>  | <a href="#">Page 3</a> 
<ul class="gallery">
        <li><a href="#"><img src="img/z.jpg" /></a></li>
        <li><a href="#"><img src="img/x.jpg" /></a></li>
	<li><a href="#"><img src="img/y.jpg" /></a></li>
	<li><a href="#"><img src="img/a.jpg" /></a></li>
	<li><a href="#"><img src="img/u.jpg" /></a></li>
	<li><a href="#"><img src="img/w.jpg" /></a></li>
</ul>
and here is the actual preview-


Now what i want is when user clicks on page 1 link two of images should vanish or go invisible.
i've written a javascript code to do that and it works perfectly.

my problem is, when any two images go invisible others occupy the black space cause by this. But i want them to be on same position as they were before it. I can't figure out correct positioning attribute and where to place it in css.

can somebody explain me.
phazorRise is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-13-2011, 06:33 AM Re: CSS layout problem. I tried positioning variations still not working
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
I'm not 100% about this, and I'm not sure I fully understand what you are trying to accomplish. But I'm guessing you're making the images disappear by adding "display:none;"? Try changing it to "display:hidden;" instead. The difference is that "none" will completely remove the element, whereas "hidden" will only make it invisible but it will still be there and occopy space, I think
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 06-13-2011, 06:52 AM Re: CSS layout problem. I tried positioning variations still not working
phazorRise's Avatar
Skilled Talker

Posts: 57
Name: Sachin Gutte
Trades: 0
Quote:
Originally Posted by lizciz View Post
I'm not 100% about this, and I'm not sure I fully understand what you are trying to accomplish. But I'm guessing you're making the images disappear by adding "display:none;"? Try changing it to "display:hidden;" instead. The difference is that "none" will completely remove the element, whereas "hidden" will only make it invisible but it will still be there and occopy space, I think
ummm...,I'm not using dispay:none property. I'm using jquery fadeOut function to vanish images smoothly. and it does change the layout when images fadeOut of view.
Any help for this.
Thank you !
phazorRise is offline
Reply With Quote
View Public Profile
 
Old 06-13-2011, 01:25 PM Re: CSS layout problem. I tried positioning variations still not working
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
From the jQuery website:
Quote:
The .fadeOut() method animates the opacity of the matched elements. Once the opacity reaches 0, the display style property is set to none, so the element no longer affects the layout of the page.
Try changing fadeOut() to css('display', 'hidden') just to see if it brings the desired effect. If it does, you can work in the fade animation afterwards.
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 06-13-2011, 01:29 PM Re: CSS layout problem. I tried positioning variations still not working
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
I also found this, should be helpful to you.
http://stackoverflow.com/questions/4...t-display-none
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 06-13-2011, 10:19 PM Re: CSS layout problem. I tried positioning variations still not working
phazorRise's Avatar
Skilled Talker

Posts: 57
Name: Sachin Gutte
Trades: 0
Quote:
Originally Posted by lizciz View Post
I also found this, should be helpful to you.
http://stackoverflow.com/questions/4...t-display-none
Thankyou very much. This really helped me.
phazorRise is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to CSS layout problem. I tried positioning variations still not working
 

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.42309 seconds with 12 queries