Target all images in jQuery

Hi, I need change the following jQuery script to target all images for a WP theme. I found two codes that may do it, but I don’t know where to place them.



or As it stands now, the script doesn’t load images, the browser takes over and loads the image.

(I’ve included the original comments in the script for safe keeping)


  // Tabs
	// Hide Donation and twitter stuff on tabs other than Info
  jQuery("#fbfwTabs li a").click(function(){

  // Advanced Settings Switcher

  // Troubleshooting & Settings Switcher

  // Hide Custom Expresion textarea if not needed
  var galleryType = jQuery("input:radio[name=mfbfw_galleryType]:checked").val();

  switch (galleryType) {
	case "all":
	case "none":
	case "post":
	  jQuery("#customExpressionBlock").css("display", "none");

  jQuery("#mfbfw_galleryTypeAll").click(function () {

  jQuery("#mfbfw_galleryTypePost").click(function () {

  jQuery("#mfbfw_galleryTypeCustom").click(function () {


You can place it anywhere within the jQuery DOM ready function

jQuery(function() {

The code you posted looks like it will only work for an image named ‘left1.gif’ what about all images in any post, isn’t there some wildcard you can use ? When you say DOM selector do you mean I can place it anywhere within the script, I haven’t gotten up to speed with DOM yet !

Sorry i misinterpreted what you were asking in your original question, would the script be hiding all the images on the page or only specific images you want?

The script / add-on would be triggering all the images and hiding none.

Correct me if I’m wrong but is what your wanting a lazy loader so the images only load when you scroll down the page?

The script should execute for all images, jpeg, png etc as that is it’s purpose. At this point it’s not working why I want to do this change so it works again :slight_smile:

SgLegend. The script did work on older versions of WP where as all images once clicked would load in a window. For a few versions of WP it hasn’t worked and I enjoy this image viewer.