Hello,
I didnât see the js for the solution up on the site to diagnose, so I took a look at the page in general.
There are a few things you might look into.
First, the way youâre inserting jQuery is unusual, and not something I understand to be a âgoodâ way of going about things. The reason to use the window.jQuery || document.write(scripttags) construct would be if to have a backup local copy of a resource that you otherwise use from a remote host. Which is to say that it looks like youâre doing a check for jQuery at a point where it will always be false, and inserting a script pointing at the CDN, in which case youâd be better served to just have the script tag written normally up in the head of the page.
See here: http://stackoverflow.com/questions/5257923/how-to-load-local-script-files-as-fallback-in-cases-where-cdn-are-blocked-unavai
Next, jQuery 1.5 is pretty old, and the â.onâ function Iâm using didnât come along until jQuery 1.7. Theyâre up to 1.12 now, and even have a 2.x branch. Iâd recommend updating it if you can get away with it.
You can use a variant with the .delegate method, which is supported by 1.5.
$("#socialMedia #twitter").delegate("#twitter-widget-0","DOMSubtreeModified propertychange", function(){
hideTweetMedia();
});
I exported the html/js/css for your home page, moved the jquery script tags into head, and got rid of the .write, and updated the fix to use the âdelegateâ method, and it worked. I did the same thing by updating the jquery version to 1.7.2 and the original fix worked.
So, you have some options, obviously thereâs a few changes needed just to use this fix. But I would argue that those changes are things you should probably figure out a way to do anyway.
In any case, if you decide not to update jQuery, hereâs the code, tailored to your home-page, that I tested and saw working.
$(document).ready(function() {
var hideTweetMedia = function() {
$("#socialMedia #twitter").find(".twitter-timeline").contents().find(".timeline-Tweet-media").css("display", "none");
$("#twitter-widget-0").css("height", "100%");
$("#socialMedia #twitter").find(".twitter-timeline").contents().find(".timeline-TweetList").bind("DOMSubtreeModified propertychange", function() {
hideTweetMedia(this);
}
);
}
$("#socialMedia #twitter").delegate("#twitter-widget-0","DOMSubtreeModified propertychange", function() {
hideTweetMedia();
});
});
On the other hand, if you do decide to update jQuery, hereâs the code, tailored to your home-page, that I tested and saw working.
$(document).ready(function() {
var hideTweetMedia = function() {
$("#socialMedia #twitter").find(".twitter-timeline").contents().find(".timeline-Tweet-media").css("display", "none");
$("#twitter-widget-0").css("height", "100%");
$("#socialMedia #twitter").find(".twitter-timeline").contents().find(".timeline-TweetList").bind("DOMSubtreeModified propertychange",
function() {
hideTweetMedia(this);
}
);
}
$("#socialMedia #twitter").on("DOMSubtreeModified propertychange","#twitter-widget-0", function() {
hideTweetMedia();
});
});
Good luck!