ok thanks i see what you mean...
I have then to find a generic name for the two scripts then the order they are mentioned in the onload will be the same order they load into the page, right ?
One last thing: what syntax should i use to wrap this two scripts into a name(); i'll call onload ? Is...
Thanks sirlojik,
but...
Seems it's not working:
Here my issue: I disable css, and the script remains activated. It adds a big white space between the 2 layers ( the margin-top value is still calculated )... And if i disable Js and css then i have regular plain text ( no more white space )...
I believe if you say so but how do i manage to put this as the 2 scripts are in a differenr area in my page ( and don't use onload, only the first does ).
Here is the copy of my two scripts and they should be loaded in this order. Lets say the first needs 1 sec or 2 to position the layer...
Hi users,
I am using two scripts in a page
- A script to setup the position of a layer
- A script to preload some images in page
The 2 scripts execute themselves at the same time, making the div i want to position at a very wrong position while images are preloading. When the preload is done...
Thanks sirlojik.
One last remark:
is it possible to add a simple routine that will execute the script if css is enabled, such as:
if document.getElementById = true; // > execute the script
else = void; // do not move any margin, do not perform the
// DetectChange();
SCRIPT CONTENT
Is it...
Hi users,
I am building a script that checks every n interval (1 second for example) the offsetHeight of two layers. If this value changes it updates margin-top value for another layer. Here is below the basic structure i set up:
function screen()
var screenSize = screen.offsetWidth...
Ok,
here comes a start:
var firstDiv = document.getElementById("FirstOne");
var secondDiv = document.getElementById("SecondOne");
var artDiv = document.getElementById("Article");
artDiv.style.marginTop = (firstDiv.offsetHeight + secondDiv.offsetHeight) + "px";
That is ideally a solution i...
hi there,
I'm trying to set a margin-top value for a layer C wich would be the sum of two fixed layers height above: A and B. I can have no precise control in css, even with relative units, of C position , since A and B vary in height according to their content and the screen size of user.
The...
I am using a single browser window so this could be possible
even if this window is the parent.
Any idea of a script that could restore the window to its initial size before it was resized
something like script.go -1.
I don't know if this is possible anyway, i mean to restore back any action...
window.resizeTo(width, height);
could i use it this way:
<script type="text/javascript">
function resize() {
window.resizeTo(width, height);
}
</script>
<a href="#" onclick="resize"> ... </a>
Hi Billy,
thanks for your answer.
To avoid the user the downside of the script wich efectively
proposes one an option to resize his window, once the window is resized, is there a function called on an onclick event to resize the window back to its original size.
Such as window size history go -1.
var h = document.documentElement.clientHeight-100 + "px";
even if i don't catch any js errors
why does this break the layout and cancels the wrapper height?
Are you sure there is no other way to code this ?
Thanks for your replies...
Thanks JontyMC this is what i was searching but it breaks the layout, vertical align effect by adjusting the height of the layer to the same height as the image...so no more vertical align: middle effect...
This shouldn't be that hard...
I just want the wrapper layer to extend from under a layer...
Any idea how i can do that ?
In fact i need to substract 100px from the clientHeight and not from h
Somehow this should be
var h = document.documentElement.clientHeight-100"px";
But i know this isn't the correct syntax.
If you can help...
Hello there again,
so here is the last version i have
function changeDivHeight() {
var h = document.documentElement.clientHeight;
var image = document.getElementById('image');
document.getElementById('wrapper').style.height = h- 100 + "px";
image.style.marginTop = Math.floor((h-image.height)/2)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.