WordPress.org

Forums

Background Manager
Let user choose image from Image Set? (4 posts)

  1. Twansparant
    Member
    Posted 1 year ago #

    Hi there,

    I stumbled upon this plugin and it's almost exactly what I'm looking for.
    However I'm wundering if it's possible to insert an background image set into a page with the shortcode and let the visitor choose an image from the set and at that point change the background for the rest of the session and not right away?
    Thanks!

    Cheers, Toine

    http://wordpress.org/plugins/background-manager/

  2. Twansparant
    Member
    Posted 1 year ago #

    So far, I've come to this piece of javascript that kinda works:

    $('.page.gallery .main .thumbnails li a.thumbnail').click(function(event){
    	event.preventDefault();
    	var bgimage = $(this).attr('href');
    	var bgalt = $(this).children("img").attr('alt');
    
    	myatu_bgm.addTopImage(
    		"{% if opacity < 100 %}-moz-opacity:.{{ opacity }};filter:alpha(opacity={{ opacity }});opacity:.{{ opacity }};{% endif %}",
    		function() {
    			if ((typeof myatu_bgm !== "undefined") && (myatu_bgm.initial_ease_in === "true")) {
    				$(this).fadeIn("slow")
    			} else {
    				$(this).show()
    			}
    			myatu_bgm.switchBackground(); // Works only with timer slideshow
    		}
    	)
    });

    This script does add the correct image into the myatu_bgm_img_group div when clicking on the corresponding thumbnail and the background does change accordingly!

    However, this only works when selecting the Select an image: Every 10 seconds option in the settings. Besides that, the timer of the slideshow continues after manually switching the background.

    Another issue is that the previous images aren't removed from the myatu_bgm_img_group div when adding one by clicking a thumbnail.

    What I actually want is that no background is set yet (or if there's no other option, the random option is active) and that visitors can set the background themselves for the rest of their session by clicking the thumbnails.

    Anyone has an idea on how to achieve this?
    Thanks!

  3. Twansparant
    Member
    Posted 1 year ago #

    I got a bit further (I think), if I change the myatu_bgm.current_background.url and myatu_bgm.current_background.alt parameters it does change the background when clicking with the Select an image: At each browser session option selected.

    $('.page.gallery .main .thumbnails li a.thumbnail').click(function(event){
    	event.preventDefault();
    	var bgimage = $(this).attr('href');
    	var bgalt = $(this).children("img").attr('alt');
    
    	myatu_bgm.current_background.url = bgimage; // Works sort of, doesn't update size and cookie
    	myatu_bgm.current_background.alt = bgalt;
    
    	myatu_bgm.addTopImage(
    		"{% if opacity < 100 %}-moz-opacity:.{{ opacity }};filter:alpha(opacity={{ opacity }});opacity:.{{ opacity }};{% endif %}",
    		function() {
    			// Either fade in or display immediately
    			if ((typeof myatu_bgm !== "undefined") && (myatu_bgm.initial_ease_in === "true")) {
    				$(this).fadeIn("slow");
    			} else {
    				$(this).show();
    			}
    			//myatu_bgm.switchBackground(); // Not neccessary when setting myatu_bgm.current_background.url
    		}
       );
    });

    However it doesn't update the dimensions of the new image, or the qTip information or the cookie... So when browsing to a new page, the background jumps back to the one it was before clicking the thumbnail...

  4. Twansparant
    Member
    Posted 1 year ago #

    Nobody no? :(

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Background Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic