There is a particular reason for the random page.
What is that reason?
There is a particular reason for the random page.
What is that reason?
Siran, I have added to your example with links to other website pages: random link (refined).xar
Any click on the image on the page picks test1.htm / test2.htm; only the Home button returns to the index.htm page.
Acorn
Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat
I can follow a lot of this but what always trips me up is how to intergrate js within Xara placeholders or buttons.
For example here is a nice script that sets up an array of url's that uses the length of the array to set up the number of url options.
How would this be intergrated into a Xara page?
Source:
http://stackoverflow.com/questions/3...andom-redirect
var sites = [
'http://www.dilbert.com',
'http://stackoverflow.com',
'http://Starwars.com'
];
var target = Math.floor(Math.random() sites.length);
window.location = sites[target];
So when your site collection grows you don't need to alter the code. You could even pack it into a function:
function goRandomSite(sites) {
var target = Math.floor(Math.random() sites.length);
window.location = sites[target];
}
Egg
Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host
Egg, in this example you could put
to the page HTML code (head) and then would use a link like thisCode:<script> function goRandomSite(sites) { var target = Math.floor(Math.random()*sites.length); window.location = sites[target]; } </script>
Please note that in your example the multiplication character is missing.Code:javascript:goRandomSite(["http://www.dilbert.com","http://stackoverflow.com","http://Starwars.com"]);
Thanks a lot for that Siran, that worked a treat.
Egg
Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host
I'd love to know how to do a random pop-up layer, working on a dice roll animation that also goes to a web-page correlated to the number rolled
press button, pop-up shows your roll then opens your web-page (36 pages possible)...
Bookmarks