I have a jpeg on a web page and want the user to be randomly directed to one of two pages when they click on the jpeg. Is this possible in Web Designer 11? Thanks.
I have a jpeg on a web page and want the user to be randomly directed to one of two pages when they click on the jpeg. Is this possible in Web Designer 11? Thanks.
Welcome to TalkGraphics
Not without a script. But Acorn or one of the other clever members may have a suggestion.
Gary W. Priester
Mr. Moderator Emeritus Dude, Sir
gwpriester.com | eyetricks-3d-stereograms.com | eyeTricks on Facebook | eyeTricks on YouTube | eyeTricks on Instagram
Depends how you define random.
Give your image one of the URLs.
Create a grid of 0 pt (not None so you can see them) lines spaced 8 px apart.
Place on top of your image and select all and Combine Shapes > Intersect All Shapes.
Now, randomly pick half of the 8 x 8 px tiles and give them the other URL.
There are variations on the above.
A JavaScript approach would be to check the time and return 0 or 1; for 0 pick one URL and for 1, the other.
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've been looking at JS examples today Acorn, but as you know I'm crap at JS.
This is really thinking outside the box. A really simple, and now obvious, solution but one I'd never of thought of. SweetGive your image one of the URLs.
Create a grid of 0 pt (not None so you can see them) lines spaced 8 px apart.
Place on top of your image and select all and Combine Shapes > Intersect All Shapes.
Now, randomly pick half of the 8 x 8 px tiles and give them the other URL.
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
As Acorn suggested you can use a random number, just specify something like
in the "Link to Web or Email address" property.Code:javascript:window.location="http://example.com/"+((Math.random()<0.5)?"link1":"link2")+".htm";
Thanks to you all for your quick response and variety of ideas. I will endeavour to get it sorted and will report back.
I have tried the javascript solution which seems the simplest. It works in Explorer, popping up a new window with the video showing. However in Chrome and Safari it pops up a new window showing the link as text on a white page. I have tried setting it to 'not specified' and 'open in a new window'. Any other suggestions?
Thanks,
Could you try to link to HTML that shows the video instead of linking to the video directly?
Ta-da - video? We started with a JPEG. Not a worry for me but if I was an end-user, would I not get frustrated in trying to see a particular video but keep in getting the other? Seems a bit random (bad pun). A bit of a back story might help.
Well done for getting it started.
I would aim for a site page that has the video embedded rather than a random (sorry) new tab or window with no return.
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
There is a particular reason for the random page. Anyway, I created a blank page with a single text box and tried to link to that. It works in Explorer 10, and the latest Firefox and Chrome browsers but not in Safari. I have checked than javascript is enabled but still no joy. If I succeed in sorting it out I will let you know. Again, many thanks.
Bookmarks