Forums

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

Home Forums JavaScript WordPress Append Sidebar Content.

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #195908
    revolutiong
    Participant

    I need to be able to move my category dropdown to different position based device size, I can’t seem to make it work with content inside the sidebar, any advice?

    jQuery(document).ready(function($) {
    
    $(".test1").detach().appendTo('.test2');
    
    }
    
    #195917
    Paulie_D
    Member

    A random piece of Jquery isn’t much help.

    However, that function only fires when the document is loaded.

    You need to add a resize function and add detection of screen size.

    You can easily google for that.

    #195930
    Alen
    Participant

    Here’s a quick demo that you can extend to fit as I’m not sure exactly what you need and what the situation is. But hopefully it’s helpful.

    http://codepen.io/alenabdula/pen/azqKVz

    #195951
    revolutiong
    Participant

    Yeah, I just wanted people to know that I used the right script. My issue is with wordpress sidebar, anything within I can not append. But any element outside works.


    @alen
    , thanks for the example. But it seems your media query isn’t working.

    #195956
    Alen
    Participant

    But it seems your media query isn’t working.


    @revolutiong
    resize the browser to less than 400px, and refresh the CodePen. Increase the width of the browser, at 400px, you’ll see text 1 be detached and appended to h2 element. You can alter the code however you like, since I don’t know the problem in detail.

    Yeah, I just wanted people to know that I used the right script.

    Ok. But we’re trying to help you. We’re also trying to understand the problem. And leaving code examples out doesn’t help.

    My issue is with wordpress sidebar

    What is the issue exactly? Don’t be vague. Show us code examples (if possible) or possibly a link to the site.

    #195957
    revolutiong
    Participant

    @alen, My bad, I was expecting it to change on resize :/

    Thank you very much for your help. I will test and get back to you.

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