EDIT:this works (gives me an alert):
if (document.cookie.indexOf("TR_LNG") >= 0) { alert('cookie found'); }
So it’s the hiding mechanism thats the problem.
BUT in console: $('.langselmain').hide('fast'); this works as well so i have no idea wtf is wrong. END EDIT
I’m trying to check for a language preference cookie, and if it exists to hide the language selection dialogue. this is what I’m using to check the cookie:
if (document.cookie.indexOf("TR_LNG") >= 0) { $('.langselmain').hide('fast'); }
and the content to hide:
<div id="langselectsplash" class="langselectsplash langselmain"><div id="select"><img src="http://sarvatma.org/wp-content/uploads/2012/08/sarvalogo2.png" /><p>
<style>#tr_setdeflang{display:none;}</style><div class="no_translate transposh_flags" ><a id="en" href="/about/" class="tr_active">English</a><a id="fr" href="/fr/about/">Français</a><a id="de" href="/de/about/">Deutsch</a><a id="ja" href="/ja/about/">日本語</a><a id="pl" href="/pl/about/">Polski</a><a id="es" href="/es/about/">Español</a></div> </p></div></div><div id="langsplashfade" class="langselmain"></div>
and its just not working
You can use: https://github.com/carhartl/jquery-cookie
js to set the cookie:
js to hide:
Working jsfiddle:
http://jsfiddle.net/3ypED/1/
Edit: no plugin http://jsfiddle.net/3ypED/4/