danwguy
04 Jan 2011, 03:01 PM
So I have a header that has a menu button on it, when you click the menu button the header the header "pulls down" to reveal the menu choices with this code...
on(release) {
getURL("javascript:moveDown();");
menuanim.gotoAndPlay(2);
}
so below my header is a <div> that I need to move down with the header that pulls down so I used this...
<script>
function moveUp() {
$("#moveme").animate({
margin-top: -250px
}, 1000 );
};
function moveDown() {
$("#moveme").animate({
margin-top: -325px
}, 1000 );
};
</script>
The div below my header looks like this...
<div id="moveme" style="margin-top: -250px; width: 920px; height: 1000px; overflow: visible;">
but when I click on the menu button nothing happens with the div. I was able to use some really basic javascript to just move the div down and up but that looks terrible. I have tried other sytax's of the jquery code like
function moveDown() {
$("#moveme").animate({
marginTop: "-325px"
}, 1000 );};
and
function moveDown() {
$("#moveme").animate({
"margin-top": "+=-325px" }, 1000 );};
But nothing is working, I cannot get the animation to actually play, If I use the jquery the div will not move, if I use simple javascript it moves but not animates and looks terrible. Can anyone please help me out here, I am seriously losing my mind.
Thank you.
on(release) {
getURL("javascript:moveDown();");
menuanim.gotoAndPlay(2);
}
so below my header is a <div> that I need to move down with the header that pulls down so I used this...
<script>
function moveUp() {
$("#moveme").animate({
margin-top: -250px
}, 1000 );
};
function moveDown() {
$("#moveme").animate({
margin-top: -325px
}, 1000 );
};
</script>
The div below my header looks like this...
<div id="moveme" style="margin-top: -250px; width: 920px; height: 1000px; overflow: visible;">
but when I click on the menu button nothing happens with the div. I was able to use some really basic javascript to just move the div down and up but that looks terrible. I have tried other sytax's of the jquery code like
function moveDown() {
$("#moveme").animate({
marginTop: "-325px"
}, 1000 );};
and
function moveDown() {
$("#moveme").animate({
"margin-top": "+=-325px" }, 1000 );};
But nothing is working, I cannot get the animation to actually play, If I use the jquery the div will not move, if I use simple javascript it moves but not animates and looks terrible. Can anyone please help me out here, I am seriously losing my mind.
Thank you.