I will tell you everything I did from the beggining, but first to answer you:
When page load the form is outside of #wrap_inner by default, thats to make it at the far side of the site like I want, and in case your screen width gets too low, it goes inside with JS, also as height gets low, the form gets lower in height aswell, and when moving it inside the #wrap_inner div, the gallery moves left and makes space for it, so there’s no more overlapping, there’s probably better methods to do what I want, but I can’t really understand your point.
I cannot make it absolute positioned from a simple reason, because then I will have to control its movement with JS, which I found out is very slow and ugly, so I passed…
I put it outside so it will be relative to the outer_div which is 100% width (the inner one is 1000px width and so is not suitable location), and if I dont set top in css it stays excactly where it is, if i set top it then goes relative to browser, that means that with JQuery I can do:
$(window).scroll(function() {
validateCSS();
});
function validateCSS() {
add = $(window).width() < 1500 ? 42 : 0;
if ($(window).scrollTop() > $('header').eq(0).height() + add)
$('#search_form').css('top', '0');
else
$('#search_form').css('top', $('header').eq(0).height() - $(window).scrollTop() + add + 'px');
}
which gies top:0 to make the element fixed positioned with the browser viewport if the height I scrolled is higher than the header’s height, and if not it puts it back relative to thte outer div.
That achieves the effect I want, so far all resolutions above 350px wide works perfectly, now I will probably make a button in that width that will make the form appear on user’s request and i’ll finish with the page.
Now my question is: the form can actually go as low as 300px in height, and that page in general to as low as 315px in width, is it ok to leave it like that? @PaulOB @RyanReese