Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-29-2007, 10:18 AM   PM User | #1
asNEas
New to the CF scene

 
Join Date: Jul 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
asNEas is an unknown quantity at this point
ajax + fade effect (works everywhere but IE...)

hi,

problem: IE6 does not pay attention to fragment of code which describes the fade effect.

clicking those links different type of content fades in.
works perfectly on Opera, FF, Safari.

javascript code:


Code:
function solidMe(subobjstr, op)
{
var subobj = document.getElementById(subobjstr);
subobj.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + op + ");";
subobj.style.opacity = op / 100;
}
Code:
function callAHAH(url, pageElement, callMessage, errorMessage)
{
document.getElementById(pageElement).innerHTML = callMessage;

try
{
req = new XMLHttpRequest(); /* e.g. Firefox */
}
catch(e)
{
try
{
req = new ActiveXObject("Msxml2.XMLHTTP"); /* IE */
}
catch (e)
{
try
{
req = new ActiveXObject("Microsoft.XMLHTTP"); /* IE */
}
catch (E)
{
req = false;
}
}
}

req.onreadystatechange = function() { responseAHAH(pageElement, errorMessage); };
req.open("GET", url, true);
req.send(null);
}

function responseAHAH(pageElement, errorMessage)
{
var output = '';

var subobj = document.getElementById(pageElement);
op = 0;
subobj.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + op + ")";
subobj.style.opacity = op;
while(op < 100) {
op = op + 10;
setTimeout("solidMe('" + pageElement + "', " + op + ")", op * 5);
}

if(req.readyState == 4)
{
if(req.status == 200)
{
output = req.responseText;
document.getElementById(pageElement).innerHTML = output;
}
else
{
document.getElementById(pageElement).innerHTML = errorMessage+"\n"+output;
}
}
}

function makeactive(tab)
{
callAHAH('/additional/content.php?id= '+tab, 'spec_content', '<p class="loading">Loading...</p>', 'Error: bad request.');
}

html code:

Code:
<a href="javascript:makeactive(1)">Home</a>
<a href="javascript:makeactive(2)">Contact</a>

<div id="spec_content"></div>

any ideas why IE is so angry on this code?

thanks a lot
asNEas is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:16 AM.


Advertisement
Log in to turn off these ads.