Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2012
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts

    4 Problems with Recent Post Slider

    Hey guys, wondering if you could help me with a couple things that are throwing me for a loop with an automated recent posts slider that I have on my Blogger site.

    1) People have complained that it's too fast, which I agree with, but I'm not sure how to change the speed.

    2) I really want to separate the title and summary for the posts to make it so the title is on top of the slider and the summary is on the bottom, but the only way I can figure out how to do this is to adjust the padding to push them apart, which causes the semi-transparent black background behind the text to cover the entire image.

    3) Since it's automated, it draws the slider image from the first picture in each post, but when it does so, he picks the source of the resized version, not the original picture. I have to manually go in and change each post's first image to the s1600 (or whatever it may be) hyperlink, otherwise it'll use the smaller one and just expand it, making it blurry. Is there a way to automate this so it just chooses the bigger version of the image?

    4) Is there an easy way to change it so instead of transitioning with a simple slide to the left, that it breaks down into pixels or something a little fancier?

    Code:
        var showpostthumbnails_gal  = true;
        var showpostsummary_gal  	= true;
    	var random_posts       		= false;
    	var numchars_gal			= 150;
    	var numposts_gal			= 10;
    function showgalleryposts(json) {
        var numPosts = json.feed.openSearch$totalResults.$t;
        var indexPosts = new Array();
    	document.write('<ul>');
        for (var i = 0; i < numPosts; ++i) {
            indexPosts[i] = i;
        }
    	if (random_posts == true){
        indexPosts.sort(function() {return 0.5 - Math.random()});
    	}
        if (numposts_gal > numPosts) {
            numposts_gal = numPosts;
        }
        for (i = 0; i < numposts_gal; ++i) {
            var entry_gal = json.feed.entry[indexPosts[i]];
    		var posttitle_gal =  entry_gal.title.$t;
            for (var k = 0; k <  entry_gal.link.length; k++) {
                if ( entry_gal.link[k].rel == 'alternate') {
                    posturl_gal =  entry_gal.link[k].href;
                    break;
                }
            }
    		if ("content" in entry_gal) {
                var postcontent_gal = entry_gal.content.$t
            }
            s = postcontent_gal;
            a = s.indexOf("<img");
            b = s.indexOf("src=\"", a);
            c = s.indexOf("\"", b + 5);
            d = s.substr(b + 5, c - b - 5);
            if ((a != -1) && (b != -1) && (c != -1) && (d != "")) {
                var thumburl_gal = d
            } else var thumburl_gal = 'http://i1133.photobucket.com/albums/m596/abu-farhan/Images_no_image.gif';
            document.write('<li><div id="slide-container"><span class="slide-desc"><h2 style="margin:10px 0px;">');
            document.write(posttitle_gal + '</h2>');
            var re = /<\S[^>]*>/g;
            postcontent_gal = postcontent_gal.replace(re, "");
            if (showpostsummary_gal == true) {
                if (postcontent_gal.length < numchars_gal) {
                    document.write(postcontent_gal);
                    document.write('</span>')
                } else {
                    postcontent_gal = postcontent_gal.substring(0, numchars_gal);
                    var quoteEnd_gal = postcontent_gal.lastIndexOf(" ");
                    postcontent_gal = postcontent_gal.substring(0, quoteEnd_gal);
                    document.write(postcontent_gal + '...');
                    document.write('</span>')
                }
            }
    		 document.write('<a href="' + posturl_gal + '"><img src="' + thumburl_gal + '" width="645px" height="360"/></a></div>');
            document.write('</li>');
        }
    	document.write('</ul>');
    	
    }
    I'd appreciate any help you guys could throw my way very much!

  • #2
    New Coder
    Join Date
    Oct 2012
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Any help guys?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •