IE Firefox positioning issues... I think
Caveat: I'm artist, not a programmer.
I pretty certain what I'm trying to accomplish is simple.
The effect is to drop three boxes (div containers with images) from the top to a set location. Fade them out, repeat indefinitely. There's a secondary effect to fade in another div but that hasn't broken at all.
The issue: per client request, the boxes can't squash (slideDown). So, I'm thinking... set the marginTop to negative number, set the container div overflow to hidden, and voila' sliding boxes.
Worked great. In Safari, on my Android phone, on an iPhone 3... Then I looked at it in IE. Nothing. No boxes. For thoroughness, tested in Firefox. Animation started, boxes came in, faded out... then nothing.
Aha! position issues, right?
Here's the code including CSS (I'm thinking the issue is there/working with the negative position).
- <style>
- div#one, div#two, div#three {
- margin:0;
- width:310px;
- display:none;
- height:43px;
- float:none;
- position:fixed;
- background:none;
- margin:0;
- top:-43;
- left:10;
- vertical-align:bottom;
- overflow:hidden;
- } /* these boxes hold the images
-
- div#three, div#two, div#one {
- height:0;
- } /* these boxes hold the images */
- div#container1194 {
- width: 680px;
- height:225px;
- border: 1px solid #cccccc;
- position:fixed;
- top:30px; /* note: this item sets position on page, needs to be different places */
- left:150px; /* note: this item sets position , etc. */
- overflow:hidden;
- } /* main container box */
- div#rightText, div#showMe, div#logoHolder {
- width:320px;
- } /* these three boxes hold static text, link text that fades in, and logo */
- div#rightText {
- float:right;
- clear:both;
- margin:0;
- margin-top:43px;
- font-family:Geneva, Arial, Helvetica, sans-serif;
- font-size:20px;
- color:#589199;
- }
- div#rightText p {
- line-height:23px;
- margin:0;
- font-stretch:narrower;
- text-indent:10px;
- }
- div#showMe {
- float:right;
- display:none;
- top:65px;
- margin-top:12px;
- text-indent:10px;
- }
- div#showMe a:link, div#showMe a:visited {
- font-family:Geneva, Arial, Helvetica, sans-serif;
- font-size:12px;
- color:#6d6f64;
- font-stretch:expanded;
- letter-spacing:1px;
- text-decoration:none;
- }
- div#showMe a:hover, div#showMe a:active {
- color:#00425f;
- }
- div#logoHolder {
- display:block;
- position:absolute;
- top:152px;
- margin:0;
- vertical-align:bottom;
- }
- </style>
- <script src="http://code.jquery.com/jquery-latest.js">
- </script>
- <script>
- var foo=1000;
- function startOver() {
- setTimeout(function(){runThree();},foo);
- };
- function displayMe() {
- $("#showMe").fadeIn(foo/5);
- };
- function runAll() {
-
- $("#three").fadeOut(foo/5);
- $("#two").fadeOut(foo/5);
- $("#one").fadeOut(foo/5);
-
- setTimeout(foo/5);
- $("#one").css({
- position:'absolute',
- });
-
- $("#three").animate({
- height:0,
- marginTop:-43},foo/5
- );
-
- $("#two").animate(
- {
- height:0,
- marginTop:-43},foo/5
-
- );
- $("#one").animate(
- {height:0,
- marginTop:-43},foo/5
- );
- setTimeout(function(){startOver();},foo/2);
- };
- function runThree() {
- $("#three").show();
- $("#three").animate(
- {height:43},foo/5
- );
- $("#three").animate(
- {marginTop:131},foo
- );
- setTimeout(function(){runTwo();},foo);
- };
- function runTwo() {
- $("#three").css({
- position:'absolute',
- top:0,
-
- });
- $("#two").show();
- $("#two").animate(
- {height:43},foo/5
- );
- $("#two").animate(
- {marginTop:88},foo
- );
- setTimeout(function(){runOne();},foo);
- };
- function runOne() {
- $("#two").css({
- position:'absolute',
- top:0,
-
- });
- $("#one").show();
- $("#one").animate(
- {height:43},foo/5
- );
- $("#one").animate(
- {marginTop:45},foo
- );
-
-
- setTimeout(function(){runAll();},foo*6);
-
- };
-
- $(window).load(function() {
- runThree();
- setTimeout(function(){displayMe();}, foo*3.75);
- });
- </script>
Anyone know which area I should be focusing on to fix? CSS or script?
Thanks in advance!