Problems arising from navigating between rtl and ltr modes on Internet Explorer 7

I have created a basic sliding animation for a div (developed from scratch without third-party plugins) that works well in IE10, FF, and Chrome, but has issues in IE 7. It still works in IE 8 though.

HTML

<div class="aboutus">
    <div class="margin_slide"></div>
    <div class="about_container">Click here to navigate to the next content div, shifting this div all the way to the left.</div>
    <div class="whatwedo_container">Some content here. Click to go back to the previous div.</div>
</div>

CSS

.about_container {
    margin: 0px auto;
    position: relative;
    width: 500px;
    background:#ddd;
    height:300px
}
.whatwedo_container {
    position: absolute;
    right: -100%;
    width: 300px;
    background:#000;
    height:300px;
    color:#fff;
    top:0;
}
.aboutus {
    background: #20407B;
    height: 400px;
    margin-top: 0;
    position: relative;
    width: 100%;
}
.margin_slide {
  margin: auto 0;
  position: relative;
  width: 1100px;
}

JQuery

$('.about_container').click(function () {
    var $slideupto = $('.margin_slide');
    var ending_right = $(window).width() - $slideupto.offset().left;
    $('.about_container').animate({
        right: ending_right
    }, 600);
    var rightpos = $(window).width() - ($(".margin_slide").offset().left + $('.whatwedo_container').outerWidth());

    $('.whatwedo_container').animate({
        right: rightpos
    }, 800);
});

$('.whatwedo_container').click(function () {
    $('.about_container').animate({
        right: '0'
    }, 600);
     $('.whatwedo_container').animate({
        right: '-100%'
    }, 600);
});

Link to Jsfiddle: http://jsfiddle.net/squidraj/uv6Q5/7/

When using IE 7, the second div slides from right to left, taking the position of the first div, but fails when trying to revert back by clicking on the second div. The first div returns to its original position, while the second div does not move back.

Any assistance would be greatly appreciated. Thank you!

Answer №1

If you want to animate your function, consider using the following code:

$('.whatwedo_container').animate({
        right: -($(window).width())
}, 600);

Check out this example on jsfiddle.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Error 404 occurred when attempting to use the DELETE method with Spring MVC and

Can anyone help me understand this issue? Everything is working fine, except for one method that isn't functioning and keeps giving a 404 error. I have a couple of requests function deleteFunc(id) { $.ajax({ dataType: "js ...

Adjusting the position of navbar links to the right in Bootstrap 4 using a toggle button

Attempting to shift the links from the left of the navbar to the right side proved to be challenging. I tried floating it to the right, using position:relative; right: 200px;, and padding-right: -200px;, but none of it worked. If anyone has any other sug ...

Is there a simpler way to check if the element is not X or if its parent is not X using jQuery?

In my coffeescript code, I have set up event listeners to track all body clicks: $('body').on 'click', (e) -> if not $(e.target).hasClass('notification') and $(e.target).parents('td.notification').lengt ...

Trigger javascript function after clicking on two buttons

I am currently working on developing a web game inspired by Duolingo. In a specific scenario, I need a function to be triggered after two button clicks to progress further. However, I am facing challenges in finding solutions online or understanding it on ...

Adjust the default margins and padding of email header images specifically for Outlook emails

I am currently working on coding an email, and I have encountered an issue with the alignment of the hero image, specifically in Outlook. https://i.sstatic.net/ap7SG.png Despite trying various solutions from previous answers to this problem (such as sett ...

Wait for two seconds after releasing a key before taking action

I am aiming to optimize my ajax calls by only sending one after the user has finished typing a keyword, such as "stackoverflow," without repeatedly sending requests with every key press. I am attempting to implement a system where an ajax call is triggered ...

Interactive Drag-and-Drop Features with Jquery Live.ImageAlign

I currently have the following code: $(document).ready(function () { $(".div1, .div2, .div3, .div4, .div5").draggable(); $("#menu").click(function () { $("<div class='div1'></div>").appendTo("#layout"); ...

Tips for organizing certain elements in a horizontal row

In the process of developing a WordPress plugin for shortcodes generation. The user can choose to create testimonials. For example, the shortcode below functions as a slider: [testimonial]Content 1[/testimonial] [testimonial]Content 2[/testimonial] [test ...

Menu Tabs with Rounded Edges

Seeking help to round the corners of a tabbed dynamic menu using Drupal and the dynamic-persistent-menu module. The code provided below is almost perfect, with 99% accuracy. View the current state of the menu here: . Can anyone assist in achieving the rema ...

Class variable remains unchanged following AJAX request

Upon completion of the ajax request, two integers are received - this.N and this.M. However, these values are not being set by the storeDims() function even though the correct decoding is done on the dims variable. This implies that I am unable to access ...

Resize an image to precisely match the height of the text automatically

I am facing a challenge where I want to embed an image inline with text, while ensuring that it matches the height of the text. I have tried using <img src="img.jpg" height=16> and also <img src="img.jpg" height="100%">, but the former does not ...

Dynamic Design with Pure CSS

I am in the process of creating a flexible layout design. Everything appears to be functioning as intended on FF, Chrome, Safari and IE8 However, I have encountered an issue with IE7. It seems to be related to the floated containers. I have attempted a fe ...

The parent class failed to implement the border radius as intended

Recently, I created an HTML table using Bootstrap V5 on my website. .reasonCode-table th, .reasonCode-table td { padding: 8px; border: 2px solid #7a7878; border-radius: 6px; } .reasonCode-table__title { text-align: center; } .rea ...

jCarousel jQuery plugin malfunctioning on iPhone devices

I am currently implementing a vertical carousel to showcase video thumbnails using sorgalla.com/projects/jcarousel/. When the thumbnails are clicked, the source of the larger video changes accordingly. My website has two versions - one with Flash navigati ...

Utilize Bootstrap button dropdown to automatically assign a selected value to a list item

I have a form with a select box that transforms into a bootstrap button after the page loads. However, I am unable to set the selected value for the converted bootstrap button drop-down li. <button type="button" class="btn dropdown-toggle btn-default" ...

Tips for eliminating extremely fine light and dark borders from a navigation bar

I recently had a client bring to my attention a very faint light line and thin dark line present in the active link of their navigation bar. Despite being barely visible, it is still there. I have attempted to adjust the CSS, but given that the lines are l ...

Exploring the elimination of box shadow on elements that overlap

view image hereI'm experiencing an issue with my HTML code where a box shadow appears in the mobile view. Despite my efforts, I cannot seem to remove it. This problem only arises in the mobile view, leading me to believe that it may be related to how ...

Utilizing Selenium with Java, you can hover over a button and choose to click on any of the available options

Currently, I am utilizing Selenium to automate the user interface using Java. Within the UI, there is an action button that, when hovered over by the User, displays two clickable options - Create and Edit. For ease of use, I have stored CSS locators as E ...

The text area in iOS 11 Safari's bootstrap modal is positioned off-center from the cursor

When using Safari with iOS 11, I noticed that the input textbox cursor is appearing outside of the input textbox. This issue is specific to iOS 11 Safari and we are unsure why it is happening. As shown in the image, the cursor is not within the email input ...

Is it possible to improve the cleanliness of a dynamic button in Jquery?

I've just finished creating a dynamic button on the screen as per my boss's request. When this button is clicked, it triggers an email window for feedback submission. My aim is to streamline this script so that I can avoid digging into ASP marku ...