Search Results

Search found 30 results on 2 pages for 'clonenode'.

Page 1/2 | 1 2  | Next Page >

  • documentFragment.cloneNode(true) doesn't clone jQuery data

    - by taber
    I have a documentFragment with several child nodes containing some .data() added like so: myDocumentFragment = document.createDocumentFragment(); for(...) { myDocumentFragment.appendChild( $('').addClass('button') .attr('href', 'javascript:void(0)') .html('click me') .data('rowData', { 'id': 103, 'test': 'testy' }) .get(0) ); } When I try to append the documentFragment to a div on the page: $('#div').append( myDocumentFragment ); I can access the data just fine: alert( $('#div a:first').data('rowData').id ); // alerts '103' But if I clone the node with cloneNode(true), I can't access the node's data. :( $('#div').append( myDocumentFragment.cloneNode(true) ); ... alert( $('#div a:first').data('rowData').id ); // alerts undefined Has anyone else done this or know of a workaround? I guess I could store the row's data in jQuery.data('#some_random_parent_div', 'rows', [array of ids]), but that kinda defeats the purpose of making the data immediately/easily available to each row. I've also read that jQuery uses documentFragments, but I'm not sure exactly how, or in what methods. Does anyone have any more details there? Thanks!

    Read the article

  • Java Node.cloneNode()

    - by Tom Brito
    Talking about the org.w3c.dom package; When I call Node.cloneNode() method from a Element(extends Node) object, which Document is used to create the new cloned Element? Example: import org.w3c.dom; class MyClass { public static void main(String[] args) throws Exception { DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.newDocument(); Element element = doc.createElement("myElement"); Element cloneElement = (Element) element.cloneNode(true); } } Which Document was used to create cloneElement?

    Read the article

  • DOM: element created with cloneNode(true) missing element when added to DOM

    - by user149327
    I'm creating a tree control and I'm attempting to use a parent element as a template for its children. To this end I'm using the element.cloneNode(true) method to deep clone the parent element. However when I insert the cloned element into the DOM it is missing certain inner elements despite having an outerHTML value identical to its parent. Surprisingly I observe the same behavior is in IE, Firefox, and Chrome leading me to believe that it is by design. This is the HTML for the node I'm attempting to clone. <SPAN class=node><A class=nodeLink href="/SparklerRestService2.aspx?q={0}" name=http://dbpedia.org/data/Taylor_Swift.rdf> <IMG class=nodeIcon alt="Taylor Swift" src="images/node.png"><SPAN class=nodeText>Taylor Swift</SPAN></A><SPAN class=nodeDescription>Taylor Swift is a swell gall who is realy great.</SPAN></SPAN> Once I've cloned the node using cloneNode(true) I examine the outerHTML property and find that it is indeed identical to the original. <SPAN class=node><A class=nodeLink href="/SparklerRestService2.aspx?q={0}" name=http://dbpedia.org/data/Taylor_Swift.rdf><IMG class=nodeIcon alt="Taylor Swift" src="images/node.png"><SPAN class=nodeText>Taylor Swift</SPAN></A><SPAN class=nodeDescription>Taylor Swift is a swell gall who is realy great.</SPAN></SPAN> However when I insert it into the DOM and inspect the result using FireBug I find that the element has been transformed: <span class="node" style="top: 0px; left: 0px;"<a class=nodeLink href="/SparklerRestService2.aspx?q={0}" name=http://dbpedia.org/data/Taylor_Swift.rdf>Taylor Swift</a><span class="nodeDescription">It's great</span></span> Notice that the grandchildren of the node (the image tag and the span tag surrounding "Taylor Swift") are missing, although strangely the great grandchild "Taylor Swift" text node has made it into the tree. Can anyone shed some light on this behavior? Why would nodes disappear after insertion into the DOM, and why am I seeing the same result in all three major browser engines?

    Read the article

  • Copy all childNodes to an other element. In javascript native way.

    - by kroko
    Hello I have to change "unknown" contents of XML. The structure and content itself is valid. Original <blabla foo="bar"> <aa>asas</aa> <ff> <cc> <dd /> </cc> </ff> <gg attr2="2"> </gg> ... ... </blabla> becomes <blabla foo="bar"> <magic> <aa>asas</aa> <ff> <cc> <dd /> </cc> </ff> <gg attr2="2"> </gg> ... ... </magic> </blabla> thus, adding a child straight under document root node (document.documentElement) and "pushing" the "original" children under that. Here it has to be done in plain javascript (ecmascript). The idea now is to // Get the root node RootNode = mymagicdoc.documentElement; // Create new magic element (that will contain contents of original root node) var magicContainer = mymagicdoc.createElement("magic"); // Copy all root node children (and their sub tree - deep copy) to magic node /* ????? here RootNodeClone = RootNode.cloneNode(true); RootNodeClone.childNodes...... */ // Remove all children from root node while(RootNode.hasChildNodes()) RootNode.removeChild(RootNode.firstChild); // Now when root node is empty add the magicContainer // node in it that contains all the children of original root node RootNode.appendChild(magicContainer); How to do that /* */ step? Or maybe someone has a much better solution in general for achieving the desirable result? Thank you in advance!

    Read the article

  • using document.createDocumentFragment() child dom elements that contain jQuery.data

    - by taber
    I want to use document.createDocumentFragment() to create an optimized collection of HTML elements that contain ".data" coming from jQuery (v 1.4.2), but I'm kind of stuck on how to get the data to surface from the HTML elements. Here's my code: var genres_html = document.createDocumentFragment(); $(xmlData).find('genres').each(function(i, node) { var genre = document.createElement('a'); $(genre).addClass('button') .attr('href', 'javascript:void(0)') .html( $(node).find('genreName:first').text() ) .data('genreData', { id: $(node).find('genreID:first').text() }); genres_html.appendChild( genre.cloneNode(true) ); }); $('#list').html(genres_html); // error: $('#list a:first').data('genreData') is null alert($('#list a:first').data('genreData').id); What am I doing wrong here? I suspect it's probably something with .cloneNode() not carrying over the data when the element is appended to the documentFragment. Sometimes there are tons of rows so I want to keep things pretty optimized, speed-wise. Thanks!

    Read the article

  • Javascript clone form?

    - by user202987
    I need to copy a form information with all types of elements and send it with AJAX. Tried these: 1. cloneNode on the form. - Doesn't work with IE, only copies text stuff properly. cloneNode on each element. Doesn't work with IE, only copies text stuff properly. Making new textareas for each element, and copying the value in. Doesn't work for textareas in IE, formatting is lost. I imagine a combination of those 3 would work for IE and FF but is there any decent solution to this? Shortness of code is a priority.

    Read the article

  • javascript will not work onload

    - by user2711818
    The javascript on the page needs to work onpage load. So I tried adding the document ready function into the code. It doesn't seem to work. http://janeucreative.com/daddychallenge/bag.html <script>$(document).ready(function() { function addItem(item) { var itemInCart = item.cloneNode(true); itemInCart.onclick = function() { removeItem(this); }; var cart = document.getElementById("cart"); cart.appendChild(itemInCart); } function removeItem(item) { var itemInItems = item.cloneNode(true); itemInItems.onclick = function() { addItem(this); }; var cart = document.getElementById("cart"); cart.removeChild(item); } init(); });</script> Any advice would be much appreciated! I'm very new to javascript and just trying to learn it a step at a time.

    Read the article

  • Dynamic Select boxes page load

    - by Chris
    Hello, I have a dynamic chained select box that I am attempting to show the value of on a page load. In my chained select box, it will default to the first option within the select box on page load, could anyone provide assitance? I stumbled upon this thread, but I can't seem to translate what they are doing with that answer to my language of CF. Dynamic chained drop downs on page refresh Here is the JS script I am using. function dynamicSelect(id1, id2) { // Feature test to see if there is enough W3C DOM support if (document.getElementById && document.getElementsByTagName) { // Obtain references to both select boxes var sel1 = document.getElementById(id1); var sel2 = document.getElementById(id2); // Clone the dynamic select box var clone = sel2.cloneNode(true); // Obtain references to all cloned options var clonedOptions = clone.getElementsByTagName("option"); // Onload init: call a generic function to display the related options in the dynamic select box refreshDynamicSelectOptions(sel1, sel2, clonedOptions); // Onchange of the main select box: call a generic function to display the related options in the dynamic select box sel1.onchange = function() { refreshDynamicSelectOptions(sel1, sel2, clonedOptions); } } } function refreshDynamicSelectOptions(sel1, sel2, clonedOptions) { // Delete all options of the dynamic select box while (sel2.options.length) { sel2.remove(0); } // Create regular expression objects for "select" and the value of the selected option of the main select box as class names var pattern1 = /( |^)(select)( |$)/; var pattern2 = new RegExp("( |^)(" + sel1.options[sel1.selectedIndex].value + ")( |$)"); // Iterate through all cloned options for (var i = 0; i < clonedOptions.length; i++) { // If the classname of a cloned option either equals "select" or equals the value of the selected option of the main select box if (clonedOptions[i].className.match(pattern1) || clonedOptions[i].className.match(pattern2)) { // Clone the option from the hidden option pool and append it to the dynamic select box sel2.appendChild(clonedOptions[i].cloneNode(true)); } } } Thanks so much for any assistance

    Read the article

  • DOMDocument programming: a lot of little dilemmas, how to solve them?

    - by Peter Krauss
    I need elegance and performance: how to decide by the "best implementation" for each DOM algorithm that I face. This simple "DOMNodeList grouper" illustrate many little dilemmas: use iterator_to_array or "populate an array", when not all items need to be copied. use clone operator, cloneNode method or import method? use parentNode::method() or documentElement::method? (see here) first removeChild or first replaceChild, no avoids "side effects"? ... My position, today, is only "do an arbitrary choice and follow it in all implementations" (like a "Convention over configuration" principle)... But, there are another considerations? About performance, there are some article showing benchmarks? PS: this is a generic DOM question, any language (PHP, Javascript, Python, etc.) have the problem.

    Read the article

  • Java Copy/Paste org.w3c.dom.Node between two running copies of the same program

    - by Jay
    I have a program that shows a tree representation of an XML file. Using a number of sources online I have Copy/Paste within a single instance of the program working. I am using the system Clipboard. What I need though is to be able to copy a node from one instance of the program and paste to a different instance of the same program. I have tried a number of different options, all resulting in the same behavior. When pasting from within the same application the clipboardContent contains a "transferable" object with the correct data along with an isLocal set to "true". When I perform the copy and then attempt the paste from another instance of the same program running the clipboardContent contains a "flavorsToData" HashMap and "flavors" values, the check for isDataFlavorSupported fails (never hits my custom class that represents the new flavor). I have tried using different values for the requestor object in the getContents() call. Likewise I have tried a few different ClipboardOwners for the setContent() call. Neither seem to change the behavior in any way. I am sorely tempted to convert the node that is being copied back into a textual XML format, and then on the paste convert back to the DOM model, but would rather not if possible. This class is used to define the DataFlavor and transferable object: import java.awt.datatransfer.*; import org.w3c.dom.Node; public class NodeCopyPaste implements Transferable { static public DataFlavor NodeFlavor; private DataFlavor [] supportedFlavors = {NodeFlavor}; public Node aNode; public NodeCopyPaste (Node paraNode) { aNode = paraNode; try { NodeFlavor = new DataFlavor (Class.forName ("org.w3c.dom.Node"), "Node"); } catch (ClassNotFoundException e) { e.printStackTrace (); } } public synchronized DataFlavor [] getTransferDataFlavors () { return (supportedFlavors); } public boolean isDataFlavorSupported (DataFlavor nodeFlavor) { return (nodeFlavor.equals (NodeFlavor)); } public synchronized Object getTransferData (DataFlavor nFlavor) throws UnsupportedFlavorException { if (nFlavor.equals (NodeFlavor)) return (this); else throw new UnsupportedFlavorException (nFlavor); } public void lostOwnership (Clipboard parClipboard, Transferable parTransferable) { } } I define a Clipboard object from the main application screen and then tie in copy and paste handlers for the mouse clicks: During initialization I assign the system clipboard: clippy = Toolkit.getDefaultToolkit().getSystemClipboard(); Copy Handler Node copyNode = ((CLIInfo) node.getUserObject()).DOMNode.cloneNode(true); NodeCopyPaste contents = new NodeCopyPaste(copyNode); clippy.setContents (contents, null); Paste Handler Transferable clipboardContent = clippy.getContents (null); Node clonedNode = null; if ((clipboardContent != null) && (clipboardContent.isDataFlavorSupported (NodeCopyPaste.NodeFlavor))) { try { NodeCopyPaste tempNCP = (NodeCopyPaste) clipboardContent.getTransferData (NodeCopyPaste.NodeFlavor); clonedNode = tempNCP.aNode.cloneNode(true); } catch (Exception e) { e.printStackTrace (); } Thanks!

    Read the article

  • DocumentFragment not appending in IE

    - by bmwbzz
    I have a select list which, when changed, pulls data via ajax and dynamically creates select lists. Then based on the data used to create the select lists (a type), I pull more data via ajax if i don't have it already and create the options for the select list and store them in a fragment. Then I append that fragment to the select list. This is zippy in FF3 and Chrome but either doesn't append the options at all or takes a long time (minutes) to append the options in IE7. Note: I am also using jQuery. code from the success callback which creates the select lists: blockDiv.empty(); var contentItemTypes = new Array(); selectLists = new Array(); for (var post in msg) { if (post != undefined) { var div = fragment.cloneNode(true); //deep copy var nameDiv = $(div.firstChild); nameDiv.text(msg[post].Name); blockDiv[0].appendChild(div); var allSelectLists = blockDiv.find('.editor-field select'); var selectList = $(allSelectLists[allSelectLists.length - 1]); var blockId = msg[post].ID; var elId = 'PageContentItem.' + blockId; selectList.attr('id', elId); selectList.attr('name', elId); var contentItemTypeId = msg[post].ContentItemTypeId; selectList.attr('cit', contentItemTypeId); if (contentItems[contentItemTypeId] != null || contentItems[contentItemTypeId] != undefined) { contentItems[contentItemTypeId] = null; } selectLists[post] = selectList; } } var firstContentTypeId = selectLists[0].attr('cit'); getContentItems(firstContentTypeId, setContentItemsForList, 0); code to get the items for the options in the select lists. function getContentItems(contentTypeId, callback, callbackParam) { if (contentItems[contentTypeId] != null || contentItems[contentTypeId] != undefined) { callback(contentTypeId, callbackParam); return; } contentItems[contentTypeId] = document.createDocumentFragment(); Q.ajax({ type: "POST", url: "/CMS/ContentItem/ListByContentType/" + contentTypeId, data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", error: function(xhr, msg, e) { var err = eval("(" + xhr.responseText + ")"); alert(err.ExceptionType + " ***** " + err.Message + " ***** " + err.StackTrace); }, success: function(msg) { var li; for (var post in msg) { if (post != undefined) { li = $('<option value="' + msg[post].ID + '">' + msg[post].Description + '</option>'); contentItems[contentTypeId].appendChild(li[0]); } } callback(contentTypeId, callbackParam); } }); } function setContentItemsForList(contentTypeId, selectIndex) { if (selectIndex < selectLists.length) { var items = contentItems[contentTypeId].cloneNode(true); selectLists[selectIndex].append($(items.childNodes)); selectIndex++; if (selectIndex < selectLists.length) { var nextContentTypeId = selectLists[selectIndex].attr('cit'); getContentItems(nextContentTypeId, setContentItemsForList, selectIndex); } } }

    Read the article

  • focus doesn't work in IE

    - by Syom
    i have the following function function change() { var input=document.getElementById('pas'); var input2= input.cloneNode(false); input2.type='password'; input.parentNode.replaceChild(input2,input); input2.focus(); } but focus() doesn't work in ie7, so what can i do! i want to have the cursor inside of input! thanks

    Read the article

  • Clone XML node PHP

    - by Kemrop
    I want to grab an xml node with its attributes plus all the chilren with their attributes and move them to a different node in the same XML file.I believe cloneNode is the most closest thing i can use.Right? Again to be more specific i am using DOM and Xpath to query the node.

    Read the article

  • javascript: how to make input selected

    - by Syom
    i have to use the following function, to change the input's type <input class="input" id="pas" type="text" name="password" style="color: #797272;" value= "<?php if ($_POST[password] != '') {echo '';} else {echo '????????';}?>" onclick="if (this.value =='????????') { this.value=''; this.style.color='black'; change(); }" /> <script type="text/javascript"> function change() { var input=document.getElementById('pas'); var input2= input.cloneNode(false); input2.type='password'; input.parentNode.replaceChild(input2,input); } </script> it works fine, but i have to reclick on input, because it creates a new input. so what can i do, if i want it to create a new input with cursor in it? thanks

    Read the article

  • Clone a node using Javascript DOM

    - by Abhimanyu
    I want to create a clone for below code using javascript DOM var summaryDiv = __createElement("div","sDiv","sDiv"+j); summaryDiv.onmouseover = function() {this.setAttribute("style","text-decoration:underline;cursor:pointer;");} summaryDiv.onmouseout = function() {this.setAttribute("style","text-decoration:none;");} if(browser.isIE) { summaryDiv.onclick = new Function("__fc.show_tooltip("+j+",'view_month')"); } else { summaryDiv.setAttribute("onclick", "__fc.show_tooltip("+j+",'view_month',event)"); } someobj.appendChild(summaryDiv); I m using obj = summaryDiv.cloneNode(true) which is creating node. but onclick event is not getting fire in case of Internet Explorer.can any body help me over it?

    Read the article

  • How can I copy an XmlNode from one XmlDocument to another?

    - by Chris Wenham
    I'm building a tool that authors/edits XML files, and I want to be able to populate it with template fragments defined in another XML file. For example, the tool has an "Add FooBarBaz Element" button that adds a element to the new document being created, and I want to add FooBarBaz by copying it from a template. Or let's say this is my template file: <Templates> <FooBarBaz Attribute="Value"> <ChildElement/> </FooBarBaz> </Templates> I can then grab a template fragment with .GetElementsByTagName("FooBarBaz"), and I'd like to be able to inject it into the new document with something like .AppendChild(templateNode). But the problem is that an XmlNode cannot be copied from one XmlDocument to another, even if you use .Clone() or .CloneNode(), because AppendChild() throws an exception saying that the template element belongs to another context. Is there an easy way to copy a System.Xml.XmlNode between System.Xml.XmlDocuments?

    Read the article

  • Modify jQuery Highlight? Javascript Regex

    - by Matrym
    How can I modify jquery highlight such that it doesn't find matches that appear directly before or after an alpha character? In other words, how do I prevent a match mid-word? /* highlight v3 Highlights arbitrary terms. <http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html> MIT license. Johann Burkard <http://johannburkard.de> <mailto:[email protected]> */ jQuery.fn.highlight = function(pat) { function innerHighlight(node, pat) { var skip = 0; if (node.nodeType == 3) { var pos = node.data.toUpperCase().indexOf(pat); if (pos >= 0) { var spannode = document.createElement('span'); spannode.className = 'highlight'; var middlebit = node.splitText(pos); var endbit = middlebit.splitText(pat.length); var middleclone = middlebit.cloneNode(true); spannode.appendChild(middleclone); middlebit.parentNode.replaceChild(spannode, middlebit); skip = 1; } } else if (node.nodeType == 1 && node.childNodes && !/(script|style)/i.test(node.tagName)) { for (var i = 0; i < node.childNodes.length; ++i) { i += innerHighlight(node.childNodes[i], pat); } } return skip; } return this.each(function() { innerHighlight(this, pat.toUpperCase()); }); }; jQuery.fn.removeHighlight = function() { return this.find("span.highlight").each(function() { this.parentNode.firstChild.nodeName; with (this.parentNode) { replaceChild(this.firstChild, this); normalize(); } }).end(); };

    Read the article

  • javascript function not working in IE 7

    - by JPro
    Hi, Can anyone please tell me how do I make this script run in IE 7? When I run this , nothing happens. <html> <body> <script language="JavaScript"> function moveSelectedOption() { // Fetch references to the <select> elements. var origin = document.getElementById('origin_select'); var target = document.getElementById('target_select'); // Fetch the selected option and clone it. var option = origin.options[origin.selectedIndex]; var copy = option.cloneNode(true); // Add the clone to the target element. target.add(copy, null); } </script> <select id="origin_select" multiple> <option value="A">A</option> <option value="B">B</option> <option value="C">C</option> </select> <select id="target_select" multiple> <option value="C1">C1</option> </select> <button onclick="moveSelectedOption()">Add</button> </body> </html>

    Read the article

  • Javascript cloned object looses its prototype functions

    - by Jake M
    I am attempting to clone an object in Javascript. I have made my own 'class' that has prototype functions. My Problem: When I clone an object, the clone cant access/call any prototype functions. I get an error when I go to access a prototype function of the clone: clone.render is not a function Can you tell me how I can clone an object and keep its prototype functions This simple JSFiddle demonstrates the error I get: http://jsfiddle.net/VHEFb/1/ function cloneObject(obj) { // Handle the 3 simple types, and null or undefined if (null == obj || "object" != typeof obj) return obj; // Handle Date if (obj instanceof Date) { var copy = new Date(); copy.setTime(obj.getTime()); return copy; } // Handle Array if (obj instanceof Array) { var copy = []; for (var i = 0, len = obj.length; i < len; ++i) { copy[i] = cloneObject(obj[i]); } return copy; } // Handle Object if (obj instanceof Object) { var copy = {}; for (var attr in obj) { if (obj.hasOwnProperty(attr)) copy[attr] = cloneObject(obj[attr]); } return copy; } throw new Error("Unable to copy obj! Its type isn't supported."); } function MyObject(name) { this.name = name; // I have arrays stored in this object also so a simple cloneNode(true) call wont copy those // thus the need for the function cloneObject(); } MyObject.prototype.render = function() { alert("Render executing: "+this.name); } var base = new MyObject("base"); var clone = cloneObject(base); clone.name = "clone"; base.render(); clone.render(); // Error here: "clone.render is not a function"

    Read the article

  • Elegant way to import XHTML nodes from xhr.responseXML into HTML document in IE?

    - by Weston Ruter
    While navigating through a site, I'm dynamically loading pages via Ajax and then only updating the elements of the page that are changed, such as the navigation state and main content area. This is similar to Lala. I am serving the site as XHTML in order to be able to have access to xhr.responseXML which I then traverse in parallel with the current document and copy the nodes over. This works very well in browsers other than IE. For IE, I have to iterate over all of the properties of each XML element I want to import into the HTML document to create it from scratch (using a function convertXMLElementToHTML()). Here's the code I'm currently using: try { nodeB = document.importNode(nodeB, true); } catch(e){ nodeB = nodeB.cloneNode(true); if(document.adoptNode) document.adoptNode(nodeB); } try { //This works in all browsers other than IE nodeA.parentNode.replaceChild(nodeB, nodeA); } //Manually clone the nodes into HTML; required for IE catch(e){ nodeA.parentNode.replaceChild(convertXMLElementToHTML(nodeB), nodeA); } Is there a more elegant solution to mirror-translating XML nodes into HTML?

    Read the article

  • JS. How to replace html element with another element/text, represented in string?

    - by EL 2002
    I have a problem with replacing html elements. For example, there is a table <table><tr><td id="idTABLE">0</td><td>END</td></tr></table> (it can be div, span, anything) And string in JS script var str='<td>1</td><td>2</td>'; (it can be anything, '123 text', '<span123 element</span 456' or ' <tr<td123</td ' or anything) How can I replace element 'idTABLE' with str? I mean really replace, so <table><tr><td id="__TABLE__">0</td><td>END</td></tr></table> becomes <table><tr><td>1</td><td>2</td><td>END</td></tr></table> //str='<td>1</td><td>2</td>'; <table><tr>123 text<td>END</td></tr></table> //'123 text' <table><tr> tr><td>123</td> <td>END</td></tr></table> //' <tr><td>123</td> ' I tried with createElement, replaceChild, cloneNode, but with no result at all =(

    Read the article

  • problem with sIFR 3 not displaying in IE just getting XXX

    - by user288306
    I am having a problem with sIFR 3 not displaying in IE. I get 3 larges black XXX in IE yet it displays fine in Firefox. I have checked i do have the most recent version of flash installed correctly. Here is the code on the page <div id="features"> <div id="mainmessage_advertisers"><h2>Advertisers</h2><br /><br /><h3><a href="">Reach your customers where they browse. Buy directly from top web publishers.</a></h3><br /><br /><br /><a href=""><img src="img/buyads.gif" border="0"></a></div> <div id="mainmessage_publishers"><h2>Publishers</h2><br /><br /><h3>Take control of your ad space and start generating more revenue than <u>ever before</u>.</h3><br /><br /><br /><a href=""><img src="img/sellads.gif" border="0"></a></div> </div>` Here is the code from my global.css #mainmessage_advertisers { width: 395px; height: 200px; padding: 90px 50px; border: 1px; float: left; } #mainmessage_publishers { width: 395px; height: 200px; padding: 90px 50px; float: right; } and here is what i have in my sifr.js /*********************************************************************** SIFR 3.0 (BETA 1) FUNCTIONS ************************************************************************/ var parseSelector=(function(){var _1=/\s*,\s*/;var _2=/\s*([\s>+~(),]|^|$)\s*/g;var _3=/([\s>+~,]|[^(]\+|^)([#.:@])/g;var _4=/^[^\s>+~]/;var _5=/[\s#.:>+~()@]|[^\s#.:>+~()@]+/g;function parseSelector(_6,_7){_7=_7||document.documentElement;var _8=_6.split(_1),_9=[];for(var i=0;i<_8.length;i++){var _b=[_7],_c=toStream(_8[i]);for(var j=0;j<_c.length;){var _e=_c[j++],_f=_c[j++],_10="";if(_c[j]=="("){while(_c[j++]!=")"&&j<_c.length){_10+=_c[j]}_10=_10.slice(0,-1)}_b=select(_b,_e,_f,_10)}_9=_9.concat(_b)}return _9}function toStream(_11){var _12=_11.replace(_2,"$1").replace(_3,"$1*$2");if(_4.test(_12)){_12=" "+_12}return _12.match(_5)||[]}function select(_13,_14,_15,_16){return (_17[_14])?_17[_14](_13,_15,_16):[]}var _18={toArray:function(_19){var a=[];for(var i=0;i<_19.length;i++){a.push(_19[i])}return a}};var dom={isTag:function(_1d,tag){return (tag=="*")||(tag.toLowerCase()==_1d.nodeName.toLowerCase())},previousSiblingElement:function(_1f){do{_1f=_1f.previousSibling}while(_1f&&_1f.nodeType!=1);return _1f},nextSiblingElement:function(_20){do{_20=_20.nextSibling}while(_20&&_20.nodeType!=1);return _20},hasClass:function(_21,_22){return (_22.className||"").match("(^|\\s)"+_21+"(\\s|$)")},getByTag:function(tag,_24){return _24.getElementsByTagName(tag)}};var _17={"#":function(_25,_26){for(var i=0;i<_25.length;i++){if(_25[i].getAttribute("id")==_26){return [_25[i]]}}return []}," ":function(_28,_29){var _2a=[];for(var i=0;i<_28.length;i++){_2a=_2a.concat(_18.toArray(dom.getByTag(_29,_28[i])))}return _2a},">":function(_2c,_2d){var _2e=[];for(var i=0,_30;i<_2c.length;i++){_30=_2c[i];for(var j=0,_32;j<_30.childNodes.length;j++){_32=_30.childNodes[j];if(_32.nodeType==1&&dom.isTag(_32,_2d)){_2e.push(_32)}}}return _2e},".":function(_33,_34){var _35=[];for(var i=0,_37;i<_33.length;i++){_37=_33[i];if(dom.hasClass([_34],_37)){_35.push(_37)}}return _35},":":function(_38,_39,_3a){return (pseudoClasses[_39])?pseudoClasses[_39](_38,_3a):[]}};parseSelector.selectors=_17;parseSelector.pseudoClasses={};parseSelector.util=_18;parseSelector.dom=dom;return parseSelector})(); var sIFR=new function(){var _3b=this;var _3c="sIFR-active";var _3d="sIFR-replaced";var _3e="sIFR-flash";var _3f="sIFR-ignore";var _40="sIFR-alternate";var _41="sIFR-class";var _42="sIFR-layout";var _43="http://www.w3.org/1999/xhtml";var _44=6;var _45=126;var _46=8;var _47="SIFR-PREFETCHED";var _48=" ";this.isActive=false;this.isEnabled=true;this.hideElements=true;this.replaceNonDisplayed=false;this.preserveSingleWhitespace=false;this.fixWrap=true;this.registerEvents=true;this.setPrefetchCookie=true;this.cookiePath="/";this.domains=[];this.fromLocal=true;this.forceClear=false;this.forceWidth=true;this.fitExactly=false;this.forceTextTransform=true;this.useDomContentLoaded=true;this.debugMode=false;this.hasFlashClassSet=false;var _49=0;var _4a=false,_4b=false;var dom=new function(){this.getBody=function(){var _4d=document.getElementsByTagName("body");if(_4d.length==1){return _4d[0]}return null};this.addClass=function(_4e,_4f){if(_4f){_4f.className=((_4f.className||"")==""?"":_4f.className+" ")+_4e}};this.removeClass=function(_50,_51){if(_51){_51.className=_51.className.replace(new RegExp("(^|\\s)"+_50+"(\\s|$)"),"").replace(/^\s+|(\s)\s+/g,"$1")}};this.hasClass=function(_52,_53){return new RegExp("(^|\\s)"+_52+"(\\s|$)").test(_53.className)};this.create=function(_54){if(document.createElementNS){return document.createElementNS(_43,_54)}return document.createElement(_54)};this.setInnerHtml=function(_55,_56){if(ua.innerHtmlSupport){_55.innerHTML=_56}else{if(ua.xhtmlSupport){_56=["<root xmlns=\"",_43,"\">",_56,"</root>"].join("");var xml=(new DOMParser()).parseFromString(_56,"text/xml");xml=document.importNode(xml.documentElement,true);while(_55.firstChild){_55.removeChild(_55.firstChild)}while(xml.firstChild){_55.appendChild(xml.firstChild)}}}};this.getComputedStyle=function(_58,_59){var _5a;if(document.defaultView&&document.defaultView.getComputedStyle){_5a=document.defaultView.getComputedStyle(_58,null)[_59]}else{if(_58.currentStyle){_5a=_58.currentStyle[_59]}}return _5a||""};this.getStyleAsInt=function(_5b,_5c,_5d){var _5e=this.getComputedStyle(_5b,_5c);if(_5d&&!/px$/.test(_5e)){return 0}_5e=parseInt(_5e);return isNaN(_5e)?0:_5e};this.getZoom=function(){return _5f.zoom.getLatest()}};this.dom=dom;var ua=new function(){var ua=navigator.userAgent.toLowerCase();var _62=(navigator.product||"").toLowerCase();this.macintosh=ua.indexOf("mac")>-1;this.windows=ua.indexOf("windows")>-1;this.quicktime=false;this.opera=ua.indexOf("opera")>-1;this.konqueror=_62.indexOf("konqueror")>-1;this.ie=false/*@cc_on || true @*/;this.ieSupported=this.ie&&!/ppc|smartphone|iemobile|msie\s5\.5/.test(ua)/*@cc_on && @_jscript_version >= 5.5 @*/;this.ieWin=this.ie&&this.windows/*@cc_on && @_jscript_version >= 5.1 @*/;this.windows=this.windows&&(!this.ie||this.ieWin);this.ieMac=this.ie&&this.macintosh/*@cc_on && @_jscript_version < 5.1 @*/;this.macintosh=this.macintosh&&(!this.ie||this.ieMac);this.safari=ua.indexOf("safari")>-1;this.webkit=ua.indexOf("applewebkit")>-1&&!this.konqueror;this.khtml=this.webkit||this.konqueror;this.gecko=!this.webkit&&_62=="gecko";this.operaVersion=this.opera&&/.*opera(\s|\/)(\d+\.\d+)/.exec(ua)?parseInt(RegExp.$2):0;this.webkitVersion=this.webkit&&/.*applewebkit\/(\d+).*/.exec(ua)?parseInt(RegExp.$1):0;this.geckoBuildDate=this.gecko&&/.*gecko\/(\d{8}).*/.exec(ua)?parseInt(RegExp.$1):0;this.konquerorVersion=this.konqueror&&/.*konqueror\/(\d\.\d).*/.exec(ua)?parseInt(RegExp.$1):0;this.flashVersion=0;if(this.ieWin){var axo;var _64=false;try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(e){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");this.flashVersion=6;axo.AllowScriptAccess="always"}catch(e){_64=this.flashVersion==6}if(!_64){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){}}}if(!_64&&axo){this.flashVersion=parseFloat(/([\d,?]+)/.exec(axo.GetVariable("$version"))[1].replace(/,/g,"."))}}else{if(navigator.plugins&&navigator.plugins["Shockwave Flash"]){var _65=navigator.plugins["Shockwave Flash"];this.flashVersion=parseFloat(/(\d+\.?\d*)/.exec(_65.description)[1]);var i=0;while(this.flashVersion>=_46&&i<navigator.mimeTypes.length){var _67=navigator.mimeTypes[i];if(_67.type=="application/x-shockwave-flash"&&_67.enabledPlugin.description.toLowerCase().indexOf("quicktime")>-1){this.flashVersion=0;this.quicktime=true}i++}}}this.flash=this.flashVersion>=_46;this.transparencySupport=this.macintosh||this.windows;this.computedStyleSupport=this.ie||document.defaultView&&document.defaultView.getComputedStyle&&(!this.gecko||this.geckoBuildDate>=20030624);this.css=true;if(this.computedStyleSupport){try{var _68=document.getElementsByTagName("head")[0];_68.style.backgroundColor="#FF0000";var _69=dom.getComputedStyle(_68,"backgroundColor");this.css=!_69||/\#F{2}0{4}|rgb\(255,\s?0,\s?0\)/i.test(_69);_68=null}catch(e){}}this.xhtmlSupport=!!window.DOMParser&&!!document.importNode;this.innerHtmlSupport;try{var n=dom.create("span");if(!this.ieMac){n.innerHTML="x"}this.innerHtmlSupport=n.innerHTML=="x"}catch(e){this.innerHtmlSupport=false}this.zoomSupport=!!(this.opera&&document.documentElement);this.geckoXml=this.gecko&&(document.contentType||"").indexOf("xml")>-1;this.requiresPrefetch=this.ieWin||this.khtml;this.verifiedKonqueror=false;this.supported=this.flash&&this.css&&(!this.ie||this.ieSupported)&&(!this.opera||this.operaVersion>=8)&&(!this.webkit||this.webkitVersion>=412)&&(!this.konqueror||this.konquerorVersion>3.5)&&this.computedStyleSupport&&(this.innerHtmlSupport||!this.khtml&&this.xhtmlSupport)};this.ua=ua;var _6b=new function(){function capitalize($){return $.toUpperCase()}this.normalize=function(str){if(_3b.preserveSingleWhitespace){return str.replace(/\s/g,_48)}return str.replace(/(\s)\s+/g,"$1")};this.textTransform=function(_6e,str){switch(_6e){case "uppercase":str=str.toUpperCase();break;case "lowercase":str=str.toLowerCase();break;case "capitalize":var _70=str;str=str.replace(/^\w|\s\w/g,capitalize);if(str.indexOf("function capitalize")!=-1){var _71=_70.replace(/(^|\s)(\w)/g,"$1$1$2$2").split(/^\w|\s\w/g);str="";for(var i=0;i<_71.length;i++){str+=_71[i].charAt(0).toUpperCase()+_71[i].substring(1)}}break}return str};this.toHexString=function(str){if(typeof (str)!="string"||!str.charAt(0)=="#"||str.length!=4&&str.length!=7){return str}str=str.replace(/#/,"");if(str.length==3){str=str.replace(/(.)(.)(.)/,"$1$1$2$2$3$3")}return "0x"+str};this.toJson=function(obj){var _75="";switch(typeof (obj)){case "string":_75="\""+obj+"\"";break;case "number":case "boolean":_75=obj.toString();break;case "object":_75=[];for(var _76 in obj){if(obj[_76]==Object.prototype[_76]){continue}_75.push("\""+_76+"\":"+_6b.toJson(obj[_76]))}_75="{"+_75.join(",")+"}";break}return _75};this.convertCssArg=function(arg){if(!arg){return {}}if(typeof (arg)=="object"){if(arg.constructor==Array){arg=arg.join("")}else{return arg}}var obj={};var _79=arg.split("}");for(var i=0;i<_79.length;i++){var $=_79[i].match(/([^\s{]+)\s*\{(.+)\s*;?\s*/);if(!$||$.length!=3){continue}if(!obj[$[1]]){obj[$[1]]={}}var _7c=$[2].split(";");for(var j=0;j<_7c.length;j++){var $2=_7c[j].match(/\s*([^:\s]+)\s*\:\s*([^\s;]+)/);if(!$2||$2.length!=3){continue}obj[$[1]][$2[1]]=$2[2]}}return obj};this.extractFromCss=function(css,_80,_81,_82){var _83=null;if(css&&css[_80]&&css[_80][_81]){_83=css[_80][_81];if(_82){delete css[_80][_81]}}return _83};this.cssToString=function(arg){var css=[];for(var _86 in arg){var _87=arg[_86];if(_87==Object.prototype[_86]){continue}css.push(_86,"{");for(var _88 in _87){if(_87[_88]==Object.prototype[_88]){continue}css.push(_88,":",_87[_88],";")}css.push("}")}return escape(css.join(""))}};this.util=_6b;var _5f={};_5f.fragmentIdentifier=new function(){this.fix=true;var _89;this.cache=function(){_89=document.title};function doFix(){document.title=_89}this.restore=function(){if(this.fix){setTimeout(doFix,0)}}};_5f.synchronizer=new function(){this.isBlocked=false;this.block=function(){this.isBlocked=true};this.unblock=function(){this.isBlocked=false;_8a.replaceAll()}};_5f.zoom=new function(){var _8b=100;this.getLatest=function(){return _8b};if(ua.zoomSupport&&ua.opera){var _8c=document.createElement("div");_8c.style.position="fixed";_8c.style.left="-65536px";_8c.style.top="0";_8c.style.height="100%";_8c.style.width="1px";_8c.style.zIndex="-32";document.documentElement.appendChild(_8c);function updateZoom(){if(!_8c){return}var _8d=window.innerHeight/_8c.offsetHeight;var _8e=Math.round(_8d*100)%10;if(_8e>5){_8d=Math.round(_8d*100)+10-_8e}else{_8d=Math.round(_8d*100)-_8e}_8b=isNaN(_8d)?100:_8d;_5f.synchronizer.unblock();document.documentElement.removeChild(_8c);_8c=null}_5f.synchronizer.block();setTimeout(updateZoom,54)}};this.hacks=_5f;var _8f={kwargs:[],replaceAll:function(){for(var i=0;i<this.kwargs.length;i++){_3b.replace(this.kwargs[i])}this.kwargs=[]}};var _8a={kwargs:[],replaceAll:_8f.replaceAll};function isValidDomain(){if(_3b.domains.length==0){return true}var _91="";try{_91=document.domain}catch(e){}if(_3b.fromLocal&&sIFR.domains[0]!="localhost"){sIFR.domains.unshift("localhost")}for(var i=0;i<_3b.domains.length;i++){if(_3b.domains[i]=="*"||_3b.domains[i]==_91){return true}}return false}this.activate=function(){if(!ua.supported||!this.isEnabled||this.isActive||!isValidDomain()){return}this.isActive=true;if(this.hideElements){this.setFlashClass()}if(ua.ieWin&&_5f.fragmentIdentifier.fix&&window.location.hash!=""){_5f.fragmentIdentifier.cache()}else{_5f.fragmentIdentifier.fix=false}if(!this.registerEvents){return}function handler(evt){_3b.initialize();if(evt&&evt.type=="load"){if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",handler,false);document.removeEventListener("load",handler,false)}if(window.removeEventListener){window.removeEventListener("load",handler,false)}}}if(window.addEventListener){if(_3b.useDomContentLoaded&&ua.gecko){document.addEventListener("DOMContentLoaded",handler,false)}window.addEventListener("load",handler,false)}else{if(ua.ieWin){if(_3b.useDomContentLoaded&&!_4a){document.write("<scr"+"ipt id=__sifr_ie_onload defer src=//:></script>");document.getElementById("__sifr_ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){handler();this.removeNode()}}}window.attachEvent("onload",handler)}}};this.setFlashClass=function(){if(this.hasFlashClassSet){return}dom.addClass(_3c,dom.getBody()||document.documentElement);this.hasFlashClassSet=true};this.removeFlashClass=function(){if(!this.hasFlashClassSet){return}dom.removeClass(_3c,dom.getBody());dom.removeClass(_3c,document.documentElement);this.hasFlashClassSet=false};this.initialize=function(){if(_4b||!this.isActive||!this.isEnabled){return}_4b=true;_8f.replaceAll();clearPrefetch()};function getSource(src){if(typeof (src)!="string"){if(src.src){src=src.src}if(typeof (src)!="string"){var _95=[];for(var _96 in src){if(src[_96]!=Object.prototype[_96]){_95.push(_96)}}_95.sort().reverse();var _97="";var i=-1;while(!_97&&++i<_95.length){if(parseFloat(_95[i])<=ua.flashVersion){_97=src[_95[i]]}}src=_97}}if(!src&&_3b.debugMode){throw new Error("sIFR: Could not determine appropriate source")}if(ua.ie&&src.charAt(0)=="/"){src=window.location.toString().replace(/([^:]+)(:\/?\/?)([^\/]+).*/,"$1$2$3")+src}return src}this.prefetch=function(){if(!ua.requiresPrefetch||!ua.supported||!this.isEnabled||!isValidDomain()){return}if(this.setPrefetchCookie&&new RegExp(";?"+_47+"=true;?").test(document.cookie)){return}try{_4a=true;if(ua.ieWin){prefetchIexplore(arguments)}else{prefetchLight(arguments)}if(this.setPrefetchCookie){document.cookie=_47+"=true;path="+this.cookiePath}}catch(e){if(_3b.debugMode){throw e}}};function prefetchIexplore(_99){for(var i=0;i<_99.length;i++){document.write("<embed src=\""+getSource(_99[i])+"\" sIFR-prefetch=\"true\" style=\"display:none;\">")}}function prefetchLight(_9b){for(var i=0;i<_9b.length;i++){new Image().src=getSource(_9b[i])}}function clearPrefetch(){if(!ua.ieWin||!_4a){return}try{var _9d=document.getElementsByTagName("embed");for(var i=_9d.length-1;i>=0;i--){var _9f=_9d[i];if(_9f.getAttribute("sIFR-prefetch")=="true"){_9f.parentNode.removeChild(_9f)}}}catch(e){}}function getRatio(_a0){if(_a0<=10){return 1.55}if(_a0<=19){return 1.45}if(_a0<=32){return 1.35}if(_a0<=71){return 1.3}return 1.25}function getFilters(obj){var _a2=[];for(var _a3 in obj){if(obj[_a3]==Object.prototype[_a3]){continue}var _a4=obj[_a3];_a3=[_a3.replace(/filter/i,"")+"Filter"];for(var _a5 in _a4){if(_a4[_a5]==Object.prototype[_a5]){continue}_a3.push(_a5+":"+escape(_6b.toJson(_6b.toHexString(_a4[_a5]))))}_a2.push(_a3.join(","))}return _a2.join(";")}this.replace=function(_a6,_a7){if(!ua.supported){return}if(_a7){for(var _a8 in _a6){if(typeof (_a7[_a8])=="undefined"){_a7[_a8]=_a6[_a8]}}_a6=_a7}if(!_4b){return _8f.kwargs.push(_a6)}if(_5f.synchronizer.isBlocked){return _8a.kwargs.push(_a6)}var _a9=_a6.elements;if(!_a9&&parseSelector){_a9=parseSelector(_a6.selector)}if(_a9.length==0){return}this.setFlashClass();var src=getSource(_a6.src);var css=_6b.convertCssArg(_a6.css);var _ac=getFilters(_a6.filters);var _ad=(_a6.forceClear==null)?_3b.forceClear:_a6.forceClear;var _ae=(_a6.fitExactly==null)?_3b.fitExactly:_a6.fitExactly;var _af=_ae||(_a6.forceWidth==null?_3b.forceWidth:_a6.forceWidth);var _b0=parseInt(_6b.extractFromCss(css,".sIFR-root","leading"))||0;var _b1=_6b.extractFromCss(css,".sIFR-root","background-color",true)||"#FFFFFF";var _b2=_6b.extractFromCss(css,".sIFR-root","opacity",true)||"100";if(parseFloat(_b2)<1){_b2=100*parseFloat(_b2)}var _b3=_6b.extractFromCss(css,".sIFR-root","kerning",true)||"";var _b4=_a6.gridFitType||_6b.extractFromCss(css,".sIFR-root","text-align")=="right"?"subpixel":"pixel";var _b5=_3b.forceTextTransform?_6b.extractFromCss(css,".sIFR-root","text-transform",true)||"none":"none";var _b6="";if(_ae){_6b.extractFromCss(css,".sIFR-root","text-align",true)}if(!_a6.modifyCss){_b6=_6b.cssToString(css)}var _b7=_a6.wmode||"";if(_b7=="transparent"){if(!ua.transparencySupport){_b7="opaque"}else{_b1="transparent"}}for(var i=0;i<_a9.length;i++){var _b9=_a9[i];if(!ua.verifiedKonqueror){if(dom.getComputedStyle(_b9,"lineHeight").match(/e\+08px/)){ua.supported=_3b.isEnabled=false;this.removeFlashClass();return}ua.verifiedKonqueror=true}if(dom.hasClass(_3d,_b9)||dom.hasClass(_3f,_b9)){continue}var _ba=false;if(!_b9.offsetHeight||!_b9.offsetWidth){if(!_3b.replaceNonDisplayed){continue}_b9.style.display="block";if(!_b9.offsetHeight||!_b9.offsetWidth){_b9.style.display="";continue}_ba=true}if(_ad&&ua.gecko){_b9.style.clear="both"}var _bb=null;if(_3b.fixWrap&&ua.ie&&dom.getComputedStyle(_b9,"display")=="block"){_bb=_b9.innerHTML;dom.setInnerHtml(_b9,"X")}var _bc=dom.getStyleAsInt(_b9,"width",ua.ie);if(ua.ie&&_bc==0){var _bd=dom.getStyleAsInt(_b9,"paddingRight",true);var _be=dom.getStyleAsInt(_b9,"paddingLeft",true);var _bf=dom.getStyleAsInt(_b9,"borderRightWidth",true);var _c0=dom.getStyleAsInt(_b9,"borderLeftWidth",true);_bc=_b9.offsetWidth-_be-_bd-_c0-_bf}if(_bb&&_3b.fixWrap&&ua.ie){dom.setInnerHtml(_b9,_bb)}var _c1,_c2;if(!ua.ie){_c1=dom.getStyleAsInt(_b9,"lineHeight");_c2=Math.floor(dom.getStyleAsInt(_b9,"height")/_c1)}else{if(ua.ie){var _bb=_b9.innerHTML;_b9.style.visibility="visible";_b9.style.overflow="visible";_b9.style.position="static";_b9.style.zoom="normal";_b9.style.writingMode="lr-tb";_b9.style.width=_b9.style.height="auto";_b9.style.maxWidth=_b9.style.maxHeight=_b9.style.styleFloat="none";var _c3=_b9;var _c4=_b9.currentStyle.hasLayout;if(_c4){dom.setInnerHtml(_b9,"<div class=\""+_42+"\">X<br />X<br />X</div>");_c3=_b9.firstChild}else{dom.setInnerHtml(_b9,"X<br />X<br />X")}var _c5=_c3.getClientRects();_c1=_c5[1].bottom-_c5[1].top;_c1=Math.ceil(_c1*0.8);if(_c4){dom.setInnerHtml(_b9,"<div class=\""+_42+"\">"+_bb+"</div>");_c3=_b9.firstChild}else{dom.setInnerHtml(_b9,_bb)}_c5=_c3.getClientRects();_c2=_c5.length;if(_c4){dom.setInnerHtml(_b9,_bb)}_b9.style.visibility=_b9.style.width=_b9.style.height=_b9.style.maxWidth=_b9.style.maxHeight=_b9.style.overflow=_b9.style.styleFloat=_b9.style.position=_b9.style.zoom=_b9.style.writingMode=""}}if(_ba){_b9.style.display=""}if(_ad&&ua.gecko){_b9.style.clear=""}_c1=Math.max(_44,_c1);_c1=Math.min(_45,_c1);if(isNaN(_c2)||!isFinite(_c2)){_c2=1}var _c6=Math.round(_c2*_c1);if(_c2>1&&_b0){_c6+=Math.round((_c2-1)*_b0)}var _c7=dom.create("span");_c7.className=_40;var _c8=_b9.cloneNode(true);for(var j=0,l=_c8.childNodes.length;j<l;j++){_c7.appendChild(_c8.childNodes[j].cloneNode(true))}if(_a6.modifyContent){_a6.modifyContent(_c8,_a6.selector)}if(_a6.modifyCss){_b6=_a6.modifyCss(css,_c8,_a6.selector)}var _cb=handleContent(_c8,_b5);if(_a6.modifyContentString){_cb=_a6.modifyContentString(_cb,_a6.selector)}if(_cb==""){continue}var _cc=["content="+_cb.replace(/\</g,"&lt;").replace(/>/g,"&gt;"),"width="+_bc,"height="+_c6,"fitexactly="+(_ae?"true":""),"tunewidth="+(_a6.tuneWidth||""),"tuneheight="+(_a6.tuneHeight||""),"offsetleft="+(_a6.offsetLeft||""),"offsettop="+(_a6.offsetTop||""),"thickness="+(_a6.thickness||""),"sharpness="+(_a6.sharpness||""),"kerning="+_b3,"gridfittype="+_b4,"zoomsupport="+ua.zoomSupport,"filters="+_ac,"opacity="+_b2,"blendmode="+(_a6.blendMode||""),"size="+_c1,"zoom="+dom.getZoom(),"css="+_b6];_cc=encodeURI(_cc.join("&amp;"));var _cd="sIFR_callback_"+_49++;var _ce={flashNode:null};window[_cd+"_DoFSCommand"]=(function(_cf){return function(_d0,arg){if(/(FSCommand\:)?resize/.test(_d0)){var $=arg.split(":");_cf.flashNode.setAttribute($[0],$[1]);if(ua.khtml){_cf.flashNode.innerHTML+=""}}}})(_ce);_c6=Math.round(_c2*getRatio(_c1)*_c1);var _d3=_af?_bc:"100%";var _d4;if(ua.ie){_d4=["<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" id=\"",_cd,"\" sifr=\"true\" width=\"",_d3,"\" height=\"",_c6,"\" class=\"",_3e,"\">","<param name=\"movie\" value=\"",src,"\"></param>","<param name=\"flashvars\" value=\"",_cc,"\"></param>","<param name=\"allowScriptAccess\" value=\"always\"></param>","<param name=\"quality\" value=\"best\"></param>","<param name=\"wmode\" value=\"",_b7,"\"></param>","<param name=\"bgcolor\" value=\"",_b1,"\"></param>","<param name=\"name\" value=\"",_cd,"\"></param>","</object>","<scr","ipt event=FSCommand(info,args) for=",_cd,">",_cd,"_DoFSCommand(info, args);","</","script>"].join("")}else{_d4=["<embed class=\"",_3e,"\" type=\"application/x-shockwave-flash\" src=\"",src,"\" quality=\"best\" flashvars=\"",_cc,"\" width=\"",_d3,"\" height=\"",_c6,"\" wmode=\"",_b7,"\" bgcolor=\"",_b1,"\" name=\"",_cd,"\" allowScriptAccess=\"always\" sifr=\"true\"></embed>"].join("")}dom.setInnerHtml(_b9,_d4);_ce.flashNode=_b9.firstChild;_b9.appendChild(_c7);dom.addClass(_3d,_b9);if(_a6.onReplacement){_a6.onReplacement(_ce.flashNode)}}_5f.fragmentIdentifier.restore()};function handleContent(_d5,_d6){var _d7=[],_d8=[];var _d9=_d5.childNodes;var i=0;while(i<_d9.length){var _db=_d9[i];if(_db.nodeType==3){var _dc=_6b.normalize(_db.nodeValue);_dc=_6b.textTransform(_d6,_dc);_d8.push(_dc.replace(/\%/g,"%25").replace(/\&/g,"%26").replace(/\,/g,"%2C").replace(/\+/g,"%2B"))}if(_db.nodeType==1){var _dd=[];var _de=_db.nodeName.toLowerCase();var _df=_db.className||"";if(/\s+/.test(_df)){if(_df.indexOf(_41)){_df=_df.match("(\\s|^)"+_41+"-([^\\s$]*)(\\s|$)")[2]}else{_df=_df.match(/^([^\s]+)/)[1]}}if(_df!=""){_dd.push("class=\""+_df+"\"")}if(_de=="a"){var _e0=_db.getAttribute("href")||"";var _e1=_db.getAttribute("target")||"";_dd.push("href=\""+_e0+"\"","target=\""+_e1+"\"")}_d8.push("<"+_de+(_dd.length>0?" ":"")+escape(_dd.join(" "))+">");if(_db.hasChildNodes()){_d7.push(i);i=0;_d9=_db.childNodes;continue}else{if(!/^(br|img)$/i.test(_db.nodeName)){_d8.push("</",_db.nodeName.toLowerCase(),">")}}}if(_d7.length>0&&!_db.nextSibling){do{i=_d7.pop();_d9=_db.parentNode.parentNode.childNodes;_db=_d9[i];if(_db){_d8.push("</",_db.nodeName.toLowerCase(),">")}}while(i<_d9.length&&_d7.length>0)}i++}return _d8.join("").replace(/\n|\r/g,"")}}; sIFR.prefetch({ src: 'swf/sifr/helvetica.swf' }); sIFR.activate(); sIFR.replace({ selector: 'h2, h3', src: 'swf/sifr/helvetica.swf', wmode: 'transparent', css: { '.sIFR-root' : { 'color': '#000000', 'font-weight': 'bold', 'letter-spacing': '-1' }, 'a': { 'text-decoration': 'none' }, 'a:link': { 'color': '#000000' }, 'a:hover': { 'color': '#000000' }, '.span': { 'color': '#979797' }, 'label': { 'color': '#E11818' } } }); sIFR.replace({ selector: 'h4', src: 'swf/sifr/helvetica.swf', wmode: 'transparent', css: { '.sIFR-root' : { 'color': '#7E7E7E', 'font-weight': 'bold', 'letter-spacing': '-0.8' }, 'a': { 'text-decoration': 'none' }, 'a:link': { 'color': '#7E7E7E' }, 'a:hover': { 'color': '#7E7E7E' }, 'label': { 'color': '#E11818' } } }); sIFR.replace({ selector: '#cart p', src: 'swf/sifr/helvetica-lt.swf', wmode: 'transparent', css: { '.sIFR-root' : { 'color': '#979797', 'font-weight': 'bold', 'letter-spacing': '-0.8' }, 'a': { 'text-decoration': 'none' }, 'a:link': { 'color': '#979797' }, 'a:hover': { 'color': '#000000' }, 'label': { 'color': '#979797' } } }); Thank you in advance for your help!

    Read the article

  • impress.js Navigation with active class

    - by ArtGoddess
    I would like to use impress.js in order to make a website, with a navigation bar. In each slide, the corresponding anchor or div must have an "active" class, in order to achieve a different link appearance. I have followed all instructions provided here: https://github.com/Ralt/impress.js/commit/f88feb8cae704ce27bd2168bdb77768f516ac2da#L2R605 but the "active" class on the correct menu must be added. This is the code that generates the menu items. How can I add for example the "active" class in the first link? /* ************************ MENU ***************************** */ // Capitalize first letter of string // @see http://stackoverflow.com/a/1026087/851498 var capitalize = function( str ) { return str.charAt(0).toUpperCase() + str.slice(1); } // `showMenu` API function creates the menu // It defines the names of each entry by the id capitalized. var showMenu = function() { // Create the menu wrapper and the element that will be cloned // for each entry. var menu = document.createElement('div'), el = document.createElement('div'); // Apply some classes menu.className = 'menu'; el.className = 'menu-item'; // Create an element that will be the "button" and append it // to the menu var button = document.createElement('div'); button.className = 'menu-button'; button.textContent = 'Menu'; menu.appendChild(button); // Now, for each div in #impress, add an entry to the menu [].forEach.call(byId('impress').firstElementChild.children, function( child, index ) { var newEl = el.cloneNode(), i = index + 1, text = i + '. ' + capitalize(child.id); // Set the text of the new element newEl.textContent = text; // Add an onclick event to the new element // We need to use a closure to make sure the index is correct (function( index ) { newEl.addEventListener('click', function() { goto(index); }); }( index )); // And append the new element to the menu menu.appendChild(newEl); }); // And append the menu to #impress document.body.appendChild(menu); }; Then, in each click it must be removed the active class on the current, and add it to the clicked element. // Remove the active class from the current active document.querySelector( '.active' )[ 0 ].classList.remove( 'active' ); // And add it to the clicked index byId('impress').firstElementChild.children[ index ].classList.add( 'active' ); Where do I have to apply this code? Thank you!

    Read the article

  • unable to trigger event in IE during clonning

    - by Abhimanyu
    Following is the code which will clone a set of div with their events(onclick) which is working fine for FF but in case of IE it is not firing events associated with each div. <html> <head> <style type='text/css'> .firstdiv{ border:1px solid red; } </style> <script language="JavaScript"> function show_tooltip(idx,condition,ev) { alert(idx +"=="+condition+"=="+ev); } function createCloneNode () { var cloneObj = document.getElementById("firstdiv").cloneNode(true); document.getElementById("maindiv").appendChild(cloneObj); } function init(){ var mainDiv = document.createElement("div"); mainDiv.id = 'maindiv'; var firstDiv = document.createElement("div"); firstDiv.id ='firstdiv'; firstDiv.className ='firstdiv'; for(var j=0;j<4;j++) { var summaryDiv = document.createElement("div"); summaryDiv.id = "sDiv"+j summaryDiv.className ='summaryDiv'; summaryDiv.onmouseover = function() {this.setAttribute("style","text-decoration:underline;cursor:pointer;");} summaryDiv.onmouseout = function() {this.setAttribute("style","text-decoration:none;");} summaryDiv.setAttribute("onclick", "show_tooltip("+j+",'view_month',event)"); summaryDiv.innerHTML = 'Div'+j; firstDiv.appendChild(summaryDiv); } mainDiv.appendChild(firstDiv); var secondDiv = document.createElement("div"); var linkDiv = document.createElement("div"); linkDiv.innerHTML ='create clone of above element'; linkDiv.onclick = function() { createCloneNode(); } secondDiv.appendChild(linkDiv); mainDiv.appendChild(secondDiv); document.body.appendChild(mainDiv); } </script> </head> <body> <script language="JavaScript"> init() </script> </body> </html> can anybody tell me whats the problem in above code please correct me..

    Read the article

  • ASP.Net/C# File Upload Progress Display

    - by Ioxp
    I am having a hard time figuring out how to do a "Please wait while file is uploading" message when the user submits the following form. So far the application works to specification with regards to checking files and uploading to the server. You will see some java script below, this is there to allow me to fake out the style of the file up load buttons so that it matches the rest of the site. I have tried to use the ASP.Net Ajax controls to do this however the updateprogress panel would not show up. In further reading it was explained that this has something to do with the Asynchronous transfer that the file upload control uses when you issue a PostedFile.SaveAs("filename") command. I also found a site that refereed to using an iframe to do the job. I'm not really sure if that's the best way to go about doing this or not so I'm asking you the professionals of stackoverflow for help to try and resolve this issue. I will be more than happy to post any spinets you need from my code to help me expedite a solution for this. <table border="0"> <tr> <td>File 1:&nbsp;</td> <td><div class="fileinputs"><input type="file" class="file" size="37" id="f1" runat="server" /></div></td> </tr> <tr> <td>File 2:&nbsp;</td> <td><div class="fileinputs"><input type="file" class="file" size="37" id="f2" runat="server" /></div></td> </tr> <tr> <td colspan="2" style="text-align:right;"><asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/Buttons/Upload_Files.gif" OnClick="Submit_Form" /></td> </tr> </table> <asp:Label ID="lblError" runat="server" Text=""></asp:Label> <script type="text/javascript"> var fakeFileUpload = document.createElement('div'); fakeFileUpload.className = 'fakefile'; var fakeInput = document.createElement('input'); fakeInput.style.width = '200px'; fakeFileUpload.appendChild(fakeInput); var image = document.createElement('img'); image.src='../Images/Buttons/Browse.gif'; fakeFileUpload.appendChild(image); var x = document.getElementsByTagName('input'); for (var i=0;i<x.length;i++) { if (x[i].type != 'file') continue; if (x[i].parentNode.className != 'fileinputs') continue; x[i].className = 'file hidden'; var clone = fakeFileUpload.cloneNode(true); x[i].parentNode.appendChild(clone); x[i].relatedElement = clone.getElementsByTagName('input')[0]; x[i].onchange = x[i].onmouseout = function () { this.relatedElement.value = this.value; } } </script>

    Read the article

1 2  | Next Page >