User:RCSDevs/spider web.js

importStylesheet('User:RCSDevs/spider_web.css');

$(document).ready(function {	var section = $('aside.ra-read-more.post-content.noprint').eq(0),		tag = section.find('h2').eq(0),		list = section.find('ul').eq(0),		showSpiderWeb = false;	tag.html('Related Pages | Toggle SpiderWeb');	list.before(' ');	var web_container = $('#web_container'),		setup = function		{			if(showSpiderWeb)			{				var width = tag.width;				web_container.show;				web_container.width(width);				web_container.animate({'height': ((width / 3) + 'px')}, 300);				$('html, body').animate({ scrollTop: $(document).height - ($(window).height - (width / 3)) }, 305);			}			else			{				web_container.animate({'height': '0px'}, 300, function {					web_container.hide; });			}		};

$('#toggle_spiderweb').click(function(event)	{		event.preventDefault;		showSpiderWeb = !showSpiderWeb;

setup; });	$(window).resize(setup); });