Note that there are some explanatory texts on larger screens.

plurals
  1. POwhy CSS3 box-shadow detaches when I animate box with jQuery?
    primarykey
    data
    text
    <p>I have an image with a box shadow one it, but when I animate it, the box shadow seems to take on a life of its own, as seen here:</p> <p><a href="http://tempesthostingservices.com/t/index.html" rel="nofollow">example</a></p> <p>It happens the same way in both chrome, firefox, and IE. I am perplexed and, more importantly at a loss at how to fix it so it looks pretty.</p> <p>Thanks for any thoughts or answers about to fix this or why it is happening.</p> <p>html/js:</p> <pre><code> &lt;div id="sliderPane"&gt; &lt;div id="slider0" class="slider"&gt;&lt;img src="1.jpg"/&gt;&lt;/div&gt; &lt;div id="slider1" class="slider"&gt;&lt;img src="2.jpg"/&gt;&lt;/div&gt; &lt;div id="slider2" class="slider"&gt;&lt;img src="3.jpg"/&gt;&lt;/div&gt; &lt;div id="numSliders"&gt;3&lt;/div&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; var numsliders; var currentSlider = 0; var interval; var slideWidth; $('#slider0').css('opacity',1); $(document).ready(function(){ numsliders = parseInt( $('#numSliders').html() ); $('#slider0').css('left', '62px'); $('#slider0').css('height', '200px'); $('#slider0').css('width', '200px'); $('#slider0').css('top', '20px'); $('#slider0').css('opacity', '1'); slideWidth = $('#slider0').width(); }); interval = window.setInterval(nextSlider, 5000); function nextSlider() { specificSlider((currentSlider + 1)%numsliders); } function specificSlider(sliderNumber){ //alert('oldslide: ' + currentSlider + " new sloide: " + sliderNumber); window.clearInterval(interval); // move the next slider on deck $('#slider' + sliderNumber).css('left', $('#sliderPane').css('width')); $('#slider' + sliderNumber).css('top', '70px'); $('#slider' + sliderNumber).css('hieght', '100px'); $('#slider' + sliderNumber).css('width', '100px'); //alert('lol'); // move old slide off, $('#slider' + currentSlider).animate({ left: '-80px', top: '50px', hieght: '100px', width: '100px', opacity: 0 },900,null); // new slide on $('#slider' + sliderNumber).animate({ left: ($('#sliderPane').width() / 2 - slideWidth / 2) + 'px', height: '200px', width: '200px', top: '20px', opacity: 1 },900,null); currentSlider = sliderNumber; interval = window.setInterval(nextSlider, 5000); } &lt;/script&gt; </code></pre> <p>css:</p> <pre><code>#sliderPane{ height: 200px; position: relative; overflow: hidden; background-image: url('sliderBG.png'); background-size: 100% 100%; padding: 20px 0; } .slider{ position: absolute; opacity: 0; top: -300px; box-shadow: 2px 2px 10px 5px rgba(0,0,0,.4); } #numSliders{ visibility: hidden; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload