Hi all -- I am working on a site using the Squarespace CMS system, and have added some simple jQuery to remove some automatically added text that comes up when filtering content (specifically "Entries in" text).
This worked smoothly without any problem until I added Google Translate script into the footer. Now the removal of the "Entries in" text is not smooth -- the "Entries in" text shows up first when the page is loaded and then gets removed, so the it feels a bit jumpy. It seems like the Google Translate script in the footer is causing the interference and I'm worried that it could interfere with any additional jQuery I might add to the site as the project progresses. I'm curious what I can do better to make sure these sorts of customizations load smoothly?
The site I'm working on (in progress) can be viewed at wohf.squarespace.com
the code I have so far is the following in the :
<script src="/storage/Scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
<!--
$(function(){
//***************************************
// Remove "Entries In" text
//***************************************
$('.journal-filter-header h2:contains(Entries in)').each(function(){
var str = $(this).html();
$(this).html(str.replace('Entries in',''));
});
});
-->
</script>
... and the following for Google Translate in the footer:
<div id="footerRight">
<div id="google_translate_element"></div>
<script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en'
}, 'google_translate_element');
}
</script>
<script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</div>
Again, any help is greatly appreciated!!