0

I have a website with a tab view that is controlled via javascript. With JS disabled, the tabs align vertically under each other. In document.ready a function is called that rearanges the tabs to be over each other so you have to click on the tab header to display the content.

When I call window.print the elements are not shown like they would be without javascript but are over each other what is suboptimal for a paper version of the website.

Is there another way or do I have to rearrange the items back to what they would look like without JS prior to calling window.print ?

EDIT: In general it works like this:

$(document).ready(function()
{
    $('.btn1').click(function()
    {
       $('.tile2').css('display', 'none');
       $('.tile1').css('display', 'block');
    });
    $('.btn2').click(function()
    {
       $('.tile1').css('display', 'none');
       $('.tile2').css('display', 'block');
    });
    $('.tile2').css('display', 'none');                  
});

http://jsfiddle.net/MK77j/

1
  • Give us some code please. HTML, JS and CSS Commented Feb 26, 2014 at 7:15

1 Answer 1

2

Use a print css to override the JS applied styles.

<link rel="stylesheet" href="print.css" type="text/css" media="print" />
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.