So I'm using jQuery's AJAX function to read some XML for me and it's worked just fine. But now I'm trying to manipulate the display property of 4 different dynamically generated divs when mouseup is triggered from option items. The size and x/y of the divs are determined by the XML and are parsed through.
My problem lies in the fact that these divs either aren't being generated or just don't show up in IE, Safari, and Chrome. In Firefox and Opera, they do work. I'm using jQuery's .append() to create the divs and then the .css() function to manipulate them. Looking in Chrome's developer tools, I am seeing that the css property being changed in the script is being overridden by the property in the stylesheet. Any fixes?
Divs created here:
case "dynamic":
var n = name;
switch(portion){
case "stub":
$('.ticket').append("<div class='stubEditable' id='"+n+"' title='stub'></div>");
break;
case "body":
$('.ticket').append("<div class='bodyEditable' id='"+n+"' title='body'></div>");
break;
}
break;
case "static":
var n = name;
switch(portion){
case "stub":
$('.ticket').append("<div class='stubEditable' id='"+n+"' title='stub'></div>");
break;
case "body":
$('.ticket').append("<div class='bodyEditable' id='"+n+"' title='body'></div>");
break;
}
break;
Mouseup functions that change the display property:
$('#StubTemplates').find('.ddindent').mouseup(function(){
var tVal = $(this).val();
var tTitle = $(this).attr('title');
if(!stubActive){
$('.stubEditable').css('display', 'none');
$('#'+tVal).css('display', 'block');
stubActive = true;
}else{
$('.stubEditable').css('display', 'none');
$('#'+tVal).css('display', 'block');
stubActive = false;
}
});
$('#StubTemplates').find('#stubTempNone').mouseup(function(){
$('.stubEditable').css('display', 'none');
});
$('#BodyTemplates').find('.ddindent').mouseup(function(){
var tVal = $(this).val();
var tTitle = $(this).attr('title');
if(!bodyActive){
$('.bodyEditable').css('display', 'none');
$('#'+tVal).css('display', 'block');
bodyActive = true;
}else{
$('.bodyEditable').css('display', 'none');
$('#'+tVal).css('display', 'block');
bodyActive = false;
}
});
$('#BodyTemplates').find('#bodyTempNone').mouseup(function(){
$('.bodyEditable').css('display', 'none');
});