I'm using the Transform2d plugin. My issue is that I'm getting a 'jump' after an
animation is completed and css is being ignored.
All divs that are being animated are set to Relative and positioned with
margin-left/margin-top as starting points in the css file.
After using alerts to get values, both IE and Firefox ignore the initial
css set to calculate distance from.
So, though in the jquery I say:
$('#cs_zoomGhost').animate({
marginLeft:'90',
marginTop:'20'
},500);
for instance, the div "cs_zoomGhost" ends up alerting different numbers
other than, in this case, 90/20, and has an annoying "jump" up of about
10 pixels when the movement is completed.
I've tried "+=70", to add to other than set as well as specifying pixels
like "90px" but the only thing that works in IE is to set the position
to absolute but then it doesn't work in FF or Safari and other compliant browsers.
css:
- #cs_zoomGhost{
- position:relative;
- margin-top:16px;
- margin-left:20px;
- width:145px;
- height:170px;
- z-index:6;
- }
html for area:
- <div id="cs_aniFocus">
- <div id="cs_stage2ArrowGrow">
- <img src="images/zoomFake.gif" id="arrowGrow" alt=""></div>
-
- <div id="cs_zoomGhost">
- <img src="images/zoomFake.gif" width="145" height="170" alt="moneyBag" id="cs_moneyBag"></div>
-
- <div id="cs_stage3HiddenPie">
- <img src="images/zoomFake.gif" id="pieChart" alt="pieChart"></div>
-
- <div id="cs_5btnPrevNext">
- <a href="#"><img src="images/prevArrow2.gif" border=0 width="19" height="20" id="prevBtn" alt=""></a> <img src="images/state1_4stage.gif" name="stateGraphic" id="stateGraphic" alt="animatedArrow"><a href="#"><img src="images/nextArrow2.gif" border=0 width="19" height="20" hspace="2" id="nextBtn" alt="nextButtonArrow"></a> </div>
- </div>
jquery upon a click:
- function stage2() {
- $("#cs_content2ClipStage3").animate({marginLeft:-330},200, function() {
- $('#cs_zoomGhost').animate({
- scale:.56,
- marginLeft:'90px',
- marginTop:'5px'
- },500, function() {
- //replaceZoom technique for piechart
- $("#cs_stage3HiddenPie").animate({scale:0},500, function() {
- $('#pieChart').attr('src','images/pieChart2.gif');
- $('#cs_stage3HiddenPie').animate({scale:.75}, 200);
- $('#cs_stage3HiddenPie').css('marginLeft', '0');
- $('#cs_stage3HiddenPie').css('marginTop', '30');
- });
- $('#cs_stage3HiddenPie').show();
- $('#cs_stage2ArrowGrow').show();
- alert($('#cs_zoomGhost').css('marginTop'));
- $('#cs_stage3HiddenPie').animate({scale:.8}, 500, function() {
- $('#arrowGrow').attr('src','images/arrowGrow2.gif');
- });
- });
- $("#stateGraphic").attr('src', 'images/state2_4stage.gif');
- }
- )};
Also, using 2d because I want scaling from the center up/down and out not
from top left and the idea of using a bigger div at size of eventual graphic
to 'fake' center scaling isn't too appealing right now.
Finally, we have tight security around here and I've no access to a
public server to put this on