The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript wordpress post carousel

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #31611

    hello there!

    i’m using these codes on a WP based site.

    the purpose is to build a scrollable thumbnail and when you click it you can see the post content in a div

    i get the post with this code

      $video_gallery = get_posts('category=9&numberposts=-1&orderby=post_name&order=ASC');
      foreach($video_gallery as $post) : setup_postdata($post);?>

    and the whole script


    $(".items img").click(function() {

    // see if same thumb is being clicked
    if ($(this).hasClass("active")) { return; }

    // calclulate large image's URL based on the thumbnail URL (flickr specific)
    var url = $(this).attr("src").replace("_t", "");

    // get handle to element that wraps the image and make it semi-transparent
    var wrap = $("#image_wrap").fadeTo("medium", 0.5);

    // the large image from
    var img = new Image();

    // call this function after it's loaded
    img.onload = function() {

    // make wrapper fully visible
    wrap.fadeTo("fast", 1);

    // change the image
    wrap.find("img").attr("src", url);


    // begin loading the image from
    img.src = url;

    // activate item
    $(".items img").removeClass("active");

    // when page loads simulate a "click" on the first image

    right now i can see only the image and not the post content.

    anyone could help me, please?

    thanks a lot

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.