Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9222271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:47:55+00:00 2026-06-18T03:47:55+00:00

I have (had) a button on my website that switched between a wide and

  • 0

I have (had) a button on my website that switched between a wide and narrow layout for articles. Since JQuery 1.9, this hasn’t worked because of the deprecation of toggle. I’m no great whizz at JS, and haven’t managed to cobble together an answer from the various questions on here, so would like someone to look at my specific case if possible. I appreciate that for someone more competent this is probably very obvious, but I’m still learning!

The site is here, e.g:

http://www.davidsmith.name/2011/09/04/Real-surreal-and-hyperreal-in-crash-and-the-beach/

Applicable part of code as follows:

<span><a id="switch" href="#" title="switch the menu"><span id="blogview">Switch to Article View</span>
 <span id="articleview" class="hide">Switch to Blog View</span></a></span><br/>
 <span id="readability" class="hide"><span class="rdbWrapper" data-show-read="1" data-show-send-to-kindle="1" data-show-print="1" data-show-email="0" data-orientation="0" data-version="1" data-bg-color="transparent"></span><script type="text/javascript">(function() {var s = document.getElementsByTagName("script")[0],rdb = document.createElement("script"); rdb.type = "text/javascript"; rdb.async = true; rdb.src = document.location.protocol + "//www.readability.com/embed.js"; s.parentNode.insertBefore(rdb, s); })();</script></span>

<script type="text/javascript">
            $('a#switch').(function () {
            $('div#right').hide('slide', { direction: 'right' }, 300);
            $('div#left').delay(300).animate({width: 950}, 600);
            $('span#blogview').toggleClass('hide');
            $('span#articleview').toggleClass('hide');
            $('span#readability').toggleClass('hide');
            }, function () {
            $('div#right').delay(500).show('slide', { direction: 'right' }, 500);
            $('div#left').animate({width: 430}, 500);
            $('span#blogview').toggleClass('hide');
            $('span#articleview').toggleClass('hide');
            $('span#readability').toggleClass('hide');}
            );
</script><br />     
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T03:47:57+00:00Added an answer on June 18, 2026 at 3:47 am

    See my answer here

    which would translate to

    $(function() {                      
       $('a#switch').on("click",function(e) {
          e.preventDefault();
          if ($(this).data("show")=="no") {
                $('div#right').hide('slide', { direction: 'right' }, 300);
                $('div#left').delay(300).animate({width: 950}, 600);
                $('span#blogview').toggleClass('hide');
                $('span#articleview').toggleClass('hide');
                $('span#readability').toggleClass('hide');
            $(this).data("show","yes");
          }   
          else {
                $('div#right').delay(500).show('slide', { direction: 'right' }, 500);
                $('div#left').animate({width: 430}, 500);
                $('span#blogview').toggleClass('hide');
                $('span#articleview').toggleClass('hide');
                $('span#readability').toggleClass('hide');
            $(this).data("show","no");     
          }
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have had several situations when i would like to do that. This could
i have a website that uses a number of containers (div's). In this scenario,
I have a jquery plugin that i'm working with for a website and I
On my view, I used to have few buttons and each button had an
I have had this problem crop up a few times and I can't figure
I have had a few problems getting this right, so I wanted to ask
I have an asp.net website that has been running well in IIS 6.0. I
I have this code: Button ssr = new Button(); ssr.Text = SSR; ssr.Location =
i have a website where certain pages have a facebook share button. I need
I realsie that similar questions have been answered here about this problem but im

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.