You probably noticed a strange ribbon at the top of the page, in the left upper corner, that says "Random Illusion!". Well, I think it is wonderful add-on for Mighty Optical Illusions. If you click that button, it will take you to one random illusion from our archives of over 1000 illusion articles.<script type="text/javascript">
//<![CDATA[
var _yourBlogUrl = "http://www.moillusions.com";
function randomPost() {
var script = document.createElement("script");
script.setAttribute("type", "text/javascript");
var theUrl = _yourBlogUrl +"/feeds/posts/summary?alt=json-in-script&callback=getTotalPostsCallback&start-index=1&max-results=1";
script.setAttribute("src", theUrl);
document.documentElement.firstChild.appendChild(script);
};
function getTotalPostsCallback(json) {
var totalResults = json.feed.openSearch$totalResults.$t;
if (totalResults > 0) {
getRandomPostNumber(totalResults);
}
};
function getRandomPostNumber(totalResults) {
var randomNumber = Math.floor((Math.random() * totalResults) + 1);
getRandomUrl(randomNumber);
};
function getRandomUrl(randomNumber) {
var script = document.createElement("script");
script.setAttribute("type", "text/javascript");
var theUrl = _yourBlogUrl +"/feeds/posts/summary?alt=json-in-script&callback=getTheUrlCallback&start-index=" + randomNumber + "&max-results=1";
script.setAttribute("src", theUrl);
document.documentElement.firstChild.appendChild(script);
};
function getTheUrlCallback(json) {
var theUrl = json.feed.entry[0].link[0].href;
window.location.href = theUrl;
}
//]]>
</script>
<a href="javascript:randomPost();">View Random Post</a>
Mighty Optical Illusions (c) is a website dedicated to optical illusions, magic tricks and puzzles. Mighty Illusions, Mighty Networks, Mighty Optical Illusions, moillusions.com, moillusions and variations are copyrighted trademark of Mighty Networks, and can not be used without written permission. All photos, pictures, videos and other shapes of art placed on this web site were submitted by individuals not connected with moillusions.com While most of the submission are made by their original artists, some of them were probably just collected from internet. If you hold copyrights to any of the illusions posted to this website, and would like us to remove them immediately, email us and we'll be glad to do so.
Awesome addition! You wondered whether it worked with all web browsers and I know it does work in Safari. I can't stop clicking it!
I love this site and visit it every day. I'd love to know how to add that random illusion ribbon onto my Myspace so people can click on it too,does anybody have any idea how???
www.Myspace/thewolfgirlliberation
It works on Opera, just so you know - and I think it's great; I've found lots entries which I've not seen before. And it's also great 'cause some of us (including myself) are too lazy to wander through the different catergories ^^
Umm, Vurdlak, i clicked 5 times and 'the devil is coming' came up twice! When are you going to post my post!
i clicked on the ribbon 3 times and got the puzzled hunter twice in a row!
btw, it works on safari
at one point the button just started giving me the same thing over and over again as if were hitting refresh. it doesnt work properly for firefox
Does nobody care about the actual illusion here? :P
Its so cool, I didn't expect that and it took ages for me to find it...
Sweet illusion...(hint- look unfocused at the middle of the world).
This took me about 3 min to find
#6 was wrong, i've got Firefox and it works perfectly
it works on MSN explorer! Oh, and that illusion to the left is awesome! with the woman and the globe!
Awesome illusion. At first I thought Australia was a nose in a cartoony face, but that's not the illusion. Now I see the real illusion. Is everything geographically correct? It's pretty cool.
so... i tried it in safari 2.0.4 and it worked prefectly, and i also tried it in (brace yourself for this one people) internet explorer 5.2.3. it didnt work in internet explorer cuz i didnt have the right plug-in, but... i dont think thats too big of a loss...
The line
window.location.href = theUrl;
would normally add a new entry to the browser history (as opposed to location.replace which would replace the current page with a new page). So, after clicking five times I'd expect to be able to go back five pages well. But somehow using the Ajax callbacks this does not work. In other words: it seems impossible to go back in the page history. Same behavior in Firefox, Safari and Camino on Mac OS X.
Too bad the history doesn't work, but a nice addition anyhow!
Adrian.
Great illusion.. though i have to admit i had to look again to not see the face lol
the illusions like others...
A hidden picture..
Great addition! I have been hoping for something like this for a while! Now the trick will be getting me to stop clicking on it...
Excellent hack, thanks for sharing.
WOAH!!! I got the same one twice!
I saw an illusion twice with he random illusions thing only.
i got this page twice with random illusion thingy
Has anyone notice that there already is a 'Next Random Illusion' button between the illusions and the comments section. That's what I've been clicking since day one. When I want to look at something specific then I go to the sidebar. And it's at a good spot, so that when you scroll down viewing the illusion there it be. And it's right above the Add your comment button to boot.
P.S. I love this site!
Guess how i came to this page...
With the random button!
:-P
This one of my most favorite application on facebook.
I don't want to hurt your feelings but it only took me a few minutes to find the owl.
Yes I do use the widget.