Reputation: 29
Instead of changing top
value the way I know how to ie, $('#div').css('top', 'VALUE')
. Are there any other methods to do this?
I'm creating a slider and on window
Resize
the next and previous buttons move set top
VALUE
.
Changing it from %
to px
doesn't solve the issue.
Help I'm looking for is around this area: if(!=$('#div').css('top' '50%')){ //keep value to 50%
}
.
Sorry for my poor use of jQuery.
Thanks and I'd greatly appreciate anyone that can help me out.
Upvotes: 0
Views: 60
Reputation: 5620
I think this is what you are looking for. First of all, jQuery is a really ineffective and glitchy solution for this kind of behavior so let's do this in CSS with position:fixed
. It will result in the same mechanics but at a design level, which is more suitable for a position.
.fixed-box {
display:block;
width:100%;
height:15px;
background:#f00;
position:fixed;
top:50%;
}
Upvotes: 1
Reputation: 639
not sure about what you exactly want, but if you simply want to get the css value you can simply do $('#div').css('top')
and it willl give you whatever the value is..
Upvotes: 0