I was not able to improve the workaround with pure CSS but here is a javascript version that doesn't change the navbar position.
The code is at the website body this time and that is required. The code has to be executed after everything is in place but before Xara's init function (xr_aeh) is executed.
The code includes some comments (everything placed after two slashes is a comment), please ask if you need further explanation.
You can have only one offset if you place the code at the website, but you may move the code to the page body if you need individual offsets per page.
You may only have one navbar with the stick to top option with the current code. If you need more with differing offsets the code has to be changed to access specific objects. But there is a problem identifying the navbar because Xara seems not to add a class name when using the name htmlclass=... at a navbar and what makes it even more different, the IDs of the navbar seem to possibly change when you add or remove additional ones.
This is the code.
Code:
<script>(function(){
var shift=60;// put the desired value that stick to top navbars should stop below the top here
var s=document.getElementsByClassName("xr_stt");
for (var i=0;i<s.length;i++){// loop over all stick to top elements
if(s[i].firstElementChild&&s[i].firstElementChild.id.substr(0,5)=="xr_nb"){// check if it is a navbar
s[i].style.top=(parseInt(s[i].style.top)-shift)+"px";// move the wrapping div up
s[i].style.visibility="hidden";// don't display the div itself (so that it doesn't prevent objects below to be selected or clicked)
s[i].firstElementChild.style.visibility="visible";// display the navbar
s[i].firstElementChild.style.paddingTop=shift+"px";// move the navbar content down inside of the navbar
}
}
})();</script>
Bookmarks