views:

64

answers:

1

Hello, and thank you for taking a look at this question.

We have developed a website which has a navigation control (Next and Previous buttons) written in Flash. These buttons use ExternalInterface to call a Javascript function in my webpage, e.g. ExternalInterface.call("showPage", pageNum);

My HTML page contains a number of Divs which each represent a single 'screen'. The first Div (screen) has the CSS Display set to 'inline' and all of the remaining are set to 'none'.

The Javascript showPage function which is called when the Flash button is clicked is as follows and it calls the hideShow function:

function showPage(which) {

    if (pagetype == "lo"){
        if(which < 0 && isRunningInFrame()){goPrev();}
        else if (which > maxPageNum && isRunningInFrame()){goNext();}
        else{dsPages.setCurrentRow(which);}
    }

    hideShow('page' + currentRow, 'page' + which);
    prevRow = currentRow;
    currentRow = which; 
}

function hideShow(hideDiv, showDiv){
    if(document.getElementById(hideDiv)!=null){
        document.getElementById(hideDiv).className = "hideDiv clear";   
    }
    if(document.getElementById(showDiv)!=null){
        document.getElementById(showDiv).className = "showDiv clear";
    }
}

This all works well in contemporary browsers and is very responsive. However our client has Internet Explorer 6 on all of their PCs (well they would wouldn't they!) and when you click Next the complete page reloads. I only assume this is happening because I can see in the bottom left corner of the browser (in the grey bar) all of the JPEG images loading. Some of the HTML pages contain approximately 50 'screens' and this is very slow when they all load over and over again.

I would be very grateful if anyone can see why this is happening or could suggest a more efficient approach to this.

Thank you.

Regards

Chris

A: 

Pointy may have a point here (no pun intended). A simple guess-suggestion would be to try placing a 'return false;' after your js-call.

eShinn
Hi Flugan, eShinn and Pointy, thanks very much for your thoughts.The website is exposed to the internet, however the site is very 'locked down' to only allow traffic in from our clients IP.Good point about what is Next (I wasn't very clear). Our content could be thought of as chapters in a book. Each Chapter is an HTML page with Divs for each page which, as you now know, have their CSS Display property manipulated to show the appropriate screen...
Chris
Wrapping around these Divs is a Template (Dreamweaver) which has a Div beneath the Editable area which embeds a Flash movie. It is this .swf file which has the buttons which the user clicks. The 'next' button in Flash calls an externalInterface method (ExternalInterface.call("showPage", pageNum);). This calls the javascript function 'showPage', detailed above.eShinn, could you please clarify where I should try the 'return false;'. Should this be in the javascript function (showPage) or within the actual javascript function in my website?Thank you again for your help.
Chris