javascript - .addClass() not working in JQuery function -


i have numerous websites on "dev" site meaning dummy data , not functionality works. happens have function in document.ready() supposed find html popup box , add class it, gives popup box little blue header bar. function:

$("document").ready( function(){     //loadsummary();     not_available_alert = $("#modalmessagealert").dialog(             {                 position: "center",                 resizable: false,                 bgiframe: true,                 autoopen: false,                 width: 250,                 height: 200,                 draggable: false,                 modal: true,                 close:function(event,ui){                     },                 open:function(event,ui){                     }             });    modifymodalheader("modalmessagealert","demo_dialog_header"); } );  function modifymodalheader(id,classname){ var refs = $("#"+id).prev(); var ref = refs.eq(0); ref.addclass(classname); }  function navigatedemo() { not_available_alert.dialog("open"); } 

html

<div id="tempxml" ></div> <div id="modalmessagealert"style="left:-200px; display:none">     <h3>this feature not available in demo household.</h3>     <input style="margin-bottom: 15px" type="button" value="close" onclick="not_available_alert.dialog('close');"/> </div> 

html link:

<input type="submit" onclick="javascript:navigatedemo();return false;" value="save" id="save"/> 

css

#modalmessagealert { background-color:#fff; cursor:pointer; padding: 10px 10px 10px 10px; text-align:center; vertical-align:middle; }  .demo_dialog_header { background-image:url(/backoffice/prospects/app360/images/demo_modal_header.gif) } 

if understand correctly modifymodalheader function supposed find tempxml div using .prev() functionality , add class tempxml div, , when user clicks "submit" aka save button shows dialog, dialog shows fine, without referenced image background-image, creates solid blue line across top 15px wide. exact same functionality , references work on pages included in same directories fine, reason can't load correctly. appreciated. -nickg

turns out had conflicting style sheets overriding class because used jquery calendar extenders , being referenced ui-widgets popup.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -