WordPress.org

Ready to get started?Download WordPress

Forums

prototype / jQuery / Read More Right Here plugin (8 posts)

  1. jakeyy
    Member
    Posted 4 years ago #

    Hiyas!

    I just rolled out the RMRH plugin onto my test install with no-conflict (prototype/jq) and it's working like a dream!

    The only issue I have with it is the (more..) icon at the bottom of the post doesn't move, stays in the centre of the post and puts a horrible break into the middle of the post!

    I've fiddled with it a bit but can't figure out how to amend this issue.

    Here's my loop:

    <?php if( is_home() && !is_paged() ):?>
    <div id="post-start">
    <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
    <h2 id="post-<?php the_ID(); ?>">
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
    <?php the_title(); ?></a></h2>
    <small><?php the_time('F jS, Y') ?></small>
    <br /><div class="entry">
    <?php the_content() ?>
    </div>
    
    <?php endwhile; ?>
    <?php endif; ?>
    </div>
    </div>
    <div class="navigation">
    <div class="alignleft"><?php posts_nav_link('','','&laquo; Previous') ?></div>
    <div class="alignright"><?php posts_nav_link('','Next &raquo;','') ?></div>
    </div>
    </div>
    <?php endif;?>

    If anybody has any pointers or suggestions I'd be happy to Guinea Pig them! :p

    Oh, and the test server URL is:

    http://whatwebuild.com/blog/blog

    Thanks!

    J.

  2. Jared Atchison
    Member
    Posted 4 years ago #

    I'm guessing you might of figured it out because it looks fine on FF 3.5 Mac.

  3. jakeyy
    Member
    Posted 4 years ago #

    Didn't manage to fix it, it's still staying in the centre of the post across all browsers for me. Any suggestions?

  4. Mark / t31os
    Moderator
    Posted 4 years ago #

    Not center here either...

    CTRL + F5 in your browser to recache the page..

  5. jakeyy
    Member
    Posted 4 years ago #

    Maybe I didn't explain it properly...

    When you click the more... button it doesn't move vertically with the new content.

    The horizontal positioning isn't a huge deal :)

    J.

  6. Mark / t31os
    Moderator
    Posted 4 years ago #

    If you can tell me specifically which area adds the content(in the JS) i might be able to suggest how you could prepend the data instead of append.

    I think the issue you describe is where the data fetched is placed. In jQuery terms it's a simple command, so would be a 1 line modification. I can't see which area does that on your site, else i'd suggest what to change.

  7. jezpas
    Member
    Posted 4 years ago #

    I'm also very interested in a solution, the unminified javascript is

    var $j = jQuery.noConflict();
    $j("document").ready(function () {
        var f = RMRH_VALUES.pluginUrl + RMRH_VALUES.loadImageName,
            b = $j(new Image()).attr("src", f).css("margin-left", "10px");
        $j("a.more-link").each(function (h) {
            anchorEl = $j(this);
            c(anchorEl)
        });
    
        function g(h) {
            var i = h.lastIndexOf("-");
            return h.substr(++i)
        }
        function c(i) {
            var h = i.attr("href");
            i.bind("click", {
                el: i,
                url: h,
                postid: g(h)
            },
            e)
        }
        function e(h) {
            var j = h.data.el,
                i = b.clone();
            j.after(i);
            i.show();
            $j.ajax({
                type: "POST",
                url: h.data.url,
                dataType: "html",
                cache: false,
                data: {
                    "wt-rmrh-redirect": "1",
                    postid: h.data.postid
                },
                error: function (k, m, l) {
                    data = '<b><font color="red">Sorry! There was an error retrieving content.<br />Click again to be taken to this entry\'s page.</font></b>';
                    a(j, i, data, true)
                },
                success: function (k, l) {
                    a(j, i, k, false)
                }
            });
            return false
        }
        function a(o, l, h, i) {
            var n = $j("<p>").html(h).hide(),
                k, m = function () {
                n.find("object").each(function () {
                    $j(this).toggle()
                })
            },
                j = new Array(function () {
                m();
                n.slideToggle(1000, function () {
                    l.fadeOut(500)
                })
            },
    
            function () {
                n.slideToggle(1000, function () {
                    l.fadeOut(500);
                    m()
                })
            });
            o.unbind("click", e);
            if ($j.browser.msie && (parseInt($j.browser.version) > 6)) {
                if (d(n)) {
                    window.location = o.attr("href");
                    return
                }
            }
            n.find("object").each(function () {
                $j(this).hide()
            });
            l.after(n);
            n.slideDown(1000, function () {
                l.fadeOut(500);
                m()
            });
            if (!i) {
                o.click(function () {
                    o.after(l);
                    l.show();
                    j[0]();
                    k = j[0];
                    j[0] = j[1];
                    j[1] = k;
                    return false
                })
            }
        }
        function d(i) {
            var h = false;
            i.find("object").each(function () {
                h = true;
                console.log(this);
                return
            });
            return h
        }
    });

    Hope that's what you need
    Thanks
    Jez

  8. zooomy
    Member
    Posted 3 years ago #

    Hi,

    has someone found a solution? I have the exact same problem... :(

    cheers,
    zooomy

Topic Closed

This topic has been closed to new replies.

About this Topic