JavaScript - Adding A Break Or New Line After 2 Iterations Of A For Loop
Hello Coding Forums,
I have a list of pub skittle players and I want a definite gap after two iterations. So.. The Red Lion ...... John and his Mrs The Two Pigs ......Martin and his mate The next pub ...... the next pair The next pub ...... the next pair Below is what I have so far : Code: var pubs = new Array('The Red Lion','The White Hart','The Cross Keys','North End Club','The Three Crowns','The British Legion','The Hare and Hounds','The Royal Oak'); var teamMembers = new Array ('Joan & Richard','Steve & Colin','Brian & Martin','Alice & Moyra',' Kirsty & Ben',' Lorri & Mark','Paul & Andy','Finchey & Sue'); for (var cplCount = 0; cplCount < teamMembers.length; cplCount = cplCount + 1) { document.write('The venue will be ' + pubs[cplCount] + ' and the players are ' + teamMembers[cplCount] + '<BR>'); } As you can see it's one big list at the moment. Any help would be greatly appreciated Morris L Similar TutorialsHiya I have created a small html with some javascript that runs through and picks up <a hrefs> and opens the links in new tabs (to check raw html for dead links) It also pastes the links on the same page, thing is, in my loop as you'll see below it pastes the link then I try to <br /> to display the next underneath like so (on the same page): Link Link Basically it works perfect for link 1 but it doesnt loop back around and grab the 2nd link. Ideally I would like numbered links with a total at the bottom, I've been sitting trying to do it for about 3 hours now Heres my code, will explain much faster if you run it: Code: <HTML> <HEAD> <TITLE> New Document </TITLE> <script type="text/javascript"> <!-- function open_links() { document.getElementById("htmlDiv").innerHTML = document.getElementById("htmlArea").value; a = document.getElementById("htmlDiv").getElementsByTagName("a"); for(i=0; i < a.length; i++) { window.open(a[i].href); var divReport = document.getElementById("report"); report.innerHTML = (a[i].href); document.report.write(item ); document.write("<br\/>"); } } --> </script> </HEAD> <BODY> <div> <textarea id="htmlArea" cols=50 rows=20></textarea> <button onclick="open_links();">Check Links</button> <div style="font-family: Lucida Console; color: rgb(255, 255, 255); font-size: 12px; background: none repeat scroll 0% 0% black; width: 523px;" id="report"> </div> </div> <div id="htmlDiv" style="display: none;"></div> </BODY> </HTML> If anyone has an idea why it wont run I'd be greatful, because what I can do is make it work fine but it makes a new page, I want it on the same page below the text area Thanks in advance for any help! Liam Hi everyone I am trying to complete some code involving a while loop. It's actually part of an assignment. Although the code is outputting ALMOST correctly there is one thing bugging me. Here is the code: Code: playersScore = rollDie(); document.write(' Sco ' + playersScore); playersPosition = playersScore + playersPosition; document.write(', Squa ' + playersPosition); indexOfNumber = findIndexOf(playersPosition, specialSquaresArray); if (indexOfNumber != -1) { document.write(', Ladder to Squa ' + connectedSquaresArray[indexOfNumber] + '<BR>'); playersPosition = connectedSquaresArray[indexOfNumber]; indexOfNumber = -1; while(playersPosition<80) { playersScore = rollDie() document.write(' Sco ' + playersScore) playersPosition = playersPosition + playersScore document.write(', Squa ' + playersPosition) indexOfNumber = findIndexOf(playersPosition, specialSquaresArray) if(indexOfNumber != -1) { document.write(', Ladder to Squa ' + connectedSquaresArray[indexOfNumber]); playersPosition = connectedSquaresArray[indexOfNumber]; } document.write('<BR>'); Now, from what I can see I think it's correct. But if if(indexOfNumber != -1) is not executed I get the following: Sco 2, Squa 2 Sco 4, Squa 6 OK Sco 4, Squa 6 should be on a new line below Sco 2, Squa 2 but no matter where I add the line break, it just will not do it. Can somebody please point me in the right direction as I am wasting so much time on this silly little problem Many thanks in advance EDIT: Ok after further fiddling with the code I entered document.write('<BR>'); in the required place and removed + '<BR>' from document.write(', Ladder to Squa ' + connectedSquaresArray[indexOfNumber] + '<BR>'); This has fixed the problem so I'm happy now. Sorry if I wasted anybodies time. I can't believe I have spent over 7 hours trying to figure this out! Hi there, I am working on javascript, the problem i have faced here is, i am unable to break the line in javascript. Actually i am using a javascript to open Microsoft Outlook Express, And in the body text i am sending some value like "Name and Address(Shown in code)". I want after task it should break the line and the value of Address will start from new line. But i am unable to do that. The code i have used is given below. Code: // JScript File function EmailIt(emailTO,strAddress,strName) { var daReferrer = document.referrer; var task = escape(document.URLUnencoded); var issue_id = document.URLUnencoded.split("="); var email = emailTO; var Address = strAddress; var Name = strName; var subject = "Issue Task number is " + issue_id[issue_id.length-1] + " - " + Address ; var body_message = "Name "+ Name + " <br />\r\n " + " Address " + Address; var mailto_link = 'mailto:'+email+'?subject='+subject+'&body='+body_message; win = window.open(mailto_link); if (win && win.open &&!win.closed) win.close(); } Also i have used following syntax to break the line: //body_message += '<br />\r\n'; //body_message += " "; //body_message += "\"\n\"";. But didn't got succeed. Can anybody help me to come out of this problem. Regards Vimal kumar Madhepura, Bihar I have these line of javascript: Code: $(document).ready(function () { /*$('#first').focus(); $(this).keyup(function (e) { if (e.keyCode == 13) { generate(); } });*/ }); function generate() { if($("input[name='name']").val().length > 1) { fi = $("input[name='name']").val().substring(0,1).toUpperCase(); var sl = ["Cool "]; var sl2 = ["Hand "]; var sl3 = ["Luke",]; { var i = Math.floor(Math.random() * sl.length); var j = Math.floor(Math.random() * sl2.length); var k = Math.floor(Math.random() * sl3.length); var nick = sl[i] + sl2[j] + sl3[k]; } { $("#answer").text("Your Name Is: " +nick); $("#answer").fadeIn("slow"); } ; } } I would like for it to return: Your Name Is: Cool Hand Luke I want the "Cool Hand Luke" to be on a separate line but I don't know how to put a linebreak in the .text string. Is this something somebody could tell me how to do? Where in the line: Code: $("#answer").text("Your Name Is: " +nick); Do I put (<br>) I have this Javascript and I am wanting to create a line break between the tweet and the time it was posted, here is the javascript, I am guessing I need to insert the <BR> tag somewhere but just not sure where? Thanks function twitterCallback2(twitters) { var statusHTML = []; for (var i=0; i<twitters.length; i++){ var username = twitters[i].user.screen_name; var status = twitters[i].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) { return '<a href="'+url+'">'+url+'</a>'; }).replace(/\B@([_a-z0-9]+)/ig, function(reply) { return reply.charAt(0)+'<a href="http://twitter.com/'+reply.substring(1)+'">'+reply.substring(1)+'</a>'; }); statusHTML.push('<li><span>'+status+'</span> <a style="font-size:85%" href="http://twitter.com/'+username+'/statuses/'+twitters[i].id_str+'">'+relative_time(twitters[i].created_at)+'</a></li>'); } document.getElementById('twitter_update_list').innerHTML = statusHTML.join(''); } function relative_time(time_value) { var values = time_value.split(" "); time_value = values[1] + " " + values[2] + ", " + values[5] + " " + values[3]; var parsed_date = Date.parse(time_value); var relative_to = (arguments.length > 1) ? arguments[1] : new Date(); var delta = parseInt((relative_to.getTime() - parsed_date) / 1000); delta = delta + (relative_to.getTimezoneOffset() * 60); if (delta < 60) { return 'less than a minute ago'; } else if(delta < 120) { return '<br>about a minute ago'; } else if(delta < (60*60)) { return (parseInt(delta / 60)).toString() + ' minutes ago'; } else if(delta < (120*60)) { return 'about an hour ago'; } else if(delta < (24*60*60)) { return 'about ' + (parseInt(delta / 3600)).toString() + ' hours ago'; } else if(delta < (48*60*60)) { return '1 day ago'; } else { return (parseInt(delta / 86400)).toString() + ' days ago'; } } Hello: First post here on CS ... I am wondering why my code will not write a new line or line break. This is fine: Code: <script> document.write("Hello and welcome to javascript!"); </script> But when I try to put a message on two lines, it does not work. The book I'm reading and several websites have stated the below codes will work, but neither do: Code: <script> document.write("Hello and welcome to javascript! \n"); document.write("It is a tricky language to learn!") </script> Code: <script> document.writeln("Hello and welcome to javascript!"); document.writeln("It is a tricky language to learn!") </script> Am I missing something? Hey guys. I'm working on a "Preview Post" function. When the Preview Post button is clicked, it should reload the page, show the preview above the textarea, then send the text back to the textarea so the user can keep working. It works until I move to a second line. If there are line breaks they don't get shown in the preview. Also, the text isn't sent back to the textarea. I have a pair of functions that are supposed to handle the input string. The first function records the input when typing, and the second function picks up the post to print as a preview: You can see what I mean he Code: function preview() { var preview = window.document.postform.inputpost.value; window.document.hidden.inputpreview.value = preview; } function copypreview() { var copypreview = '<?php echo $_POST[inputpreview]; ?>'; window.document.postform.inputpost.value = copypreview; } Here's how I use them: Code: <body onload='copypreview();'> <?php include("navbar.php"); ?> <?php if ($_GET[preview]) { echo "<table id=blog><tr><td>"; echo $_POST[inputpreview]; echo "</td></tr></table>"; } ?> <form name="postform" action="submitpost.php" method="post"> Post Title <input size="40" type="text" name="inputtitle" id="inputtitle"> <?php include("tagbar.php"); ?> <textarea onchange="preview();" cols="101" rows="20" id="inputpost" name="inputpost"></textarea> <div align=center> <input type="submit" value="Submit"/> </form> <form name="hidden" method="post" action="addpost.php?preview=1"> <input type="hidden" name="inputpreview"> <input type="submit" onClick="preview();" value="Preview Post"/> </form> Sorry I know it's a lot of code. I tried to make it as readable as possible. Can someone tell me how to fix this? I thought I might have to find a way to insert <br> tags when the user hits the Enter key, but I could have sworn this thing was working with line breaks before. Hi guys, just a quick question about a line break in JavaScript, where would I do it? If you see I have two math operators here and want them to be on two separate lines, were do I put the line break? Thanks Code: <!doctype html> <head> </head> <body> <script type="text/javascript"> var apples = 4+76; document.write(apples); var multiple = 54*11; document.write(multiple); </script> </body> </html> Hey guys I export data from Javascript to Xml file. I have tried several ways to break a line in xml file like document.write("<br/>"); or document.writeln(); etc, but seem it is impossible. Maybe you can give me a solution...... Look at below: XML File: <?xml version="1.0"?> <DATA> <Cust>< Select>Debit Card</Select> </Cust ><Cust>[ User>Jan</User ></Cust> <DATA> I want to break <Cust> from another <Cust>. Javascript: function ok_click() { var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0"); xmlDoc.async = false; xmlDoc.load("data.xml"); if (xmlDoc.readyState == 4 && xmlDoc.parseError.errorCode == 0) { var root = xmlDoc.documentElement; var e1 = document.getElementById("Select1"); var _account_type = xmlDoc.createTextNode(e1.options[e1.selectedIndex].value); var e2 = document.getElementById("Select2"); var _user = xmlDoc.createTextNode(e2.options[e2.selectedIndex].value); var account_type = xmlDoc.createNode(1, "Select", ""); var user = xmlDoc.createNode(1, "User", ""); account_type.appendChild(_account_type); user.appendChild(_user); var cust = xmlDoc.createNode(1, "Cust", ""); cust.appendChild(account_type); document.write("<br/>"); cust.appendChild(user); root.appendChild(cust); SaveXML(xmlDoc, "data.xml"); alert("Save!"); } } Your help would much appreciated Thanks Natz Hi there, I could probably say that I'm some sort of "game developer" as we're modifying an old (but great) hockey title that has html frontend. http://z6.invisionfree.com/flyermani...showtopic=1864 My JS skills suck though... I have millions of great ideas but because of my very limited skills I run into all kinds of obstacles all the time. This is yet another. I'd like to redesign the scoring summary layout in the game... so I'm trying to create a scoring line that would show the goal scorers like this: Atlanta Scoring: Antropov (1), Reasoner (1) But currently I'm always getting a line break and I get the scorers like this: Antropov (1) Reasoner (1) etc. Screenshot: My code must be sloppy as hell though: This shows the scorers: Code: var sDataHTML4 = "" var aHeaderText = new Array(nhlMsg(" Goal assist") , nhlMsg("Team"), nhlMsg("# Assists", true) ); var aHeaderWidth = new Array( 300 , 120, 50); var sHeaderHTML4 = createHeaderRow( aHeaderText , aHeaderWidth ); for ( var i = 0; i < oAwayLastGame.nNumPlayers; i++ ) { if (oAwayLastGame.aPlayerStats[i].nAssists > 0) sDataHTML4 += createDataRow4( oManagerInterface.GetPlayerFullName( oAwayLastGame.aPlayerStats[i].nPlayerID), ( oManagerInterface.GetTeamShortName(oAwayLastGame.nTeamID)), oAwayLastGame.aPlayerStats[i].nAssists) ; } return createTable( sHeaderHTML + sDataHTML + sDataHTML2 + sHeaderHTML3 + sDataHTML4 + sDataHTML3 + sGoals ); Datarow arguments: Code: function createDataRow4( args ) { var sHTML = "<tr>"; var nNumArgs = arguments.length; for( nIndex = 0 ; nIndex < nNumArgs ; nIndex++) { (nIndex == 0 ) ? sHTML += "<td class=\"fourthDataCell\">" + arguments[nIndex] + "</td>" :sHTML += "<td class=\"data2\">(" + arguments[nIndex] + ")</td>" } return sHTML += "</tr>"; } What the heck I have to do make the scorers to show all in the same line? Does "create datarow" automatically define them in one separate row? The answer must be simple but I simply can't figure it out... I have tried to Google this for days now. Thanks. Here's what should happen. 1. Get the rel attribute of the clicked link 2. For every div with class 'entry': (i)Get its 'left' position (ii) Calculate its outer height (iii)Loop through all instances of 'a.tag_filter'. If it finds the same string in the 'rel' as the one oringinally clicked on then add 1 to 'V' and break out of the loop. (iv)If 'V' is equal to 0 after the loop we know the same tag isn't present within that '.entry' so fade it out. (v)Once the fadeout has finished loop through all the '.entry' after the faded out one and get their 'left' values. (vi)If the left value of the faded entry = the left value of the current '.entry' then reposition it to the new 'top' value. What is currently happening. It runs through and fades out all the correct '.entry' elements and only after all of them have faded out does it reposition them remaining '.entry' elements. After each element is faded out I would like the repositioning loop to run so it essentially positions the remaining elements one at a time rather than all at once. Here's the development page http://www.redeemercentral.com/index.php/test/grid Here's the code I have so far Code: $('a.tag_filter').click(function(e){ e.preventDefault(); var selectTag = $(this).attr('rel'); $('div.spotlight_entry_container_grid').each(function(i){ var $entry = $(this); var tagArray = []; $('a.tag_filter', this).each(function(){ tagArray.push ($(this).attr('rel')); }); if($.inArray(selectTag,tagArray) == -1){ var leftPos = $entry.css("left"); var topPos = $entry.css("top"); $entry.fadeOut(1000, function(){ var nextLeftPos; var nextTopPos; $('div.spotlight_entry_container_grid:gt('+i+')').each(function(j) { var $laterEntry = $(this); nextLeftPos = $laterEntry.css("left"); nextTopPos = $laterEntry.css("top"); if(leftPos == nextLeftPos){ $laterEntry.animate({ top: topPos }); } }); }); } }); }); I hope that all makes sense. Any help would be very much appreciated. Thanks I know you can add data to array wiht the push() method but can you add a whole new line as in a = new Array a [1] [1,2,3] so it would create a new line a [2] [4,5,6]; The syntax to the array i think is wrong but you get the question. I am trying to develop a function that creates a certain number of form elements based on a certain number that a user inputs. It does not do what I want it to do (obviously). The problem lies within the TextBoxAppear() function. The function worked when I tested it by adding just text (document.getElementByID('leftcolumn').innerHTML = "<p>test function</p>" so I know for a fact whatever I added to the function is the problem. What has been added to the function and needs fixing is in BOLD Code: <!DOCTYPE html> <html> <head> <meta charset = "utf-8"> <title>Exercise 4</title> <style type = "text/css"> #leftcolumn { width: 300px; border: 1px solid red; float: left} #rightcolumn { width: 300px; border: 1px solid red; float: left} </style> <script> function start() { var button = document.getElementById( "submitButton" ); button.addEventListener( "click", TextBoxAppear, false ); } function TextBoxAppear() { var numberOfValuesInput = document.getElementByID( 'NumberOfValuesField' ); var numberOfValues = parseFloat( numberOfValuesInput.value ); var textBoxCreation = "<form action ="http://www.deitel.com"><p>"; for ( var i = 1; i < numberOfValues; ++i ) { textBoxCreation += "<label>Value" + i + ":<input id = 'Value" + i + "' type = 'text'></label>"; } textBoxCreation += "<input id = "calculateButton" type = "button" value = "Calculate"></p></form> document.getElementById('leftcolumnn').innerHTML = textBoxCreation; } window.addEventListener( "load", start, false ); </script> </head> <body> <form action ="http://www.deitel.com"> <p><label>Number of values to be calculated: <input id = "numberOfValuesField" type = "text"></label> <input id = "submitButton" type = "button" value = "Submit"></p> </form> <div id ="leftcolumn"><p>test left column</p></div> <div id ="rightcolumn"><p>test right column</p></div> </body> </html> hello, I am trying to add a window event listener on some links in a loop instead of doing them one by one. I've tried Code: function setListeners (){ for (var i = 0; i < document.links.length; i++) { src=document.links[i].href; document.links[i].onmousemove=changeIframeSrc(src, 'solid',1, event); document.links[i].onmouseout=changeIframeSrc(null,'none',0,event); } } and Code: function setListeners (){ for (var i = 0; i < document.links.length; i++) { src=document.links[i].href; document.links[i].onmousemove=function(a1,a2,a3,a4){ return function(){changeIframeSrc(a1,a2,a3,a4);} }(src, 'solid',1, event); } } but the event keeps coming up undefined. Any ideas on how to do this? Need some help here. I'm developing a non-server using form. The form sits on the users local computer, and generates an outlook email. There are boxes that are filled out, and each box is assigned a variable and gets transferred to an outlook email and gets plugged in to a pre-made email template. Here's what I'm trying to accomplish. I've been able to pre-populate the To: field using the variable var email = the CC: field using the variable &cc= and the BCC: field using the variable &bcc= . It would make sense that &from= or even &from: would work, but it doesn't. Appreciate the help. Ok, I'm nearly pulling my hair out with this one. I have been looking at this code for two evenings now, and rewrote it 4 times already. It started out as jQuery code and now it's just concatenating strings together. What I'm trying to do: Build a menu/outline using unordered lists from a multidimensional array. What is happening: Inside the buildMenuHTML function, if I call buildMenuHTML, the for loop only happens once (i.e. only for 'i' having a value of '0'.) If I comment out the call to itself, it goes through the for loop all 3 times, but obviously the submenus are not created. Here is the test object: Code: test = [ { "name" : "Menu 1", "url" : "menu1.html", "submenu" : [ { "name" : "menu 1 subitem 1", "url" : "menu1subitem1.html" }, { "name" : "menu 1 subitem 2", "url" : "menu1subitem2.html" } ] }, { "name" : "Menu 2", "url" : "menu2.html", "submenu" : [ { "name" : "menu 2subitem 1", "url" : "menu2subitem1.html" }, { "name" : "menu 2subitem 1", "url" : "menu2subitem1.html" } ] }, { "name" : "Menu 3", "url" : "menu3.html", "submenu" : [ { "name" : "menu 3 subitem 1", "url" : "menu3subitem1.html" }, { "name" : "menu 3 subitem 1", "url" : "menu3subitem1.html" } ] } ]; Here is the recursive function: Code: function buildMenuHTML(menuData,level) { var ul; if (level == 1) { ul = "<ul id='menu'>"; } else { ul = "<ul class='level" + level + "'>"; } for (i = 0; i < menuData.length; i++) { menuItemData = menuData[i]; ul += "<li>"; ul += "<a href='" + menuItemData.url + "'>" + menuItemData.name + "</a>"; if (typeof menuItemData.submenu != 'undefined') { ul += buildMenuHTML(menuItemData.submenu,level + 1); } ul += "</li>"; } ul += "</ul>"; return ul; } Here is how the function is called initially: Code: buildMenuHTML(test,1); This is it's return value (with indentation added for readability): Code: <ul id='menu'> <li><a href='menu1.html'>Menu 1</a> <ul class='level2'> <li><a href='menu1subitem1.html'>menu 1 subitem 1</a></li> <li><a href='menu1subitem2.html'>menu 1 subitem 2</a></li> </ul> </li> </ul> 'Menu 2' and 'Menu 3' don't show up! I'm sure it's something small that I'm overlooking, but any help would be appreciated. Hi all I'm well aware that I can't post assignments here and expect an answer, however, I have been staring at this code for so long. I feel I am close to the solution (to get the correct output to the browser) but I just cannot get it to count how many moves it takes. I don't want an answer, but a nudge in the right direction would be very grateful. As you can see from the code and the output, it will attempt to write to the browser how many moves, but only '0'. Code: function rollDie() { return Math.floor(Math.random() * 6) + 1; } /* *searches for a number in a number array. * *function takes two arguments * the number to search for * the number array to search *function returns the array index at which the number was found, or -1 if not found. */ function findIndexOf(number, numberArray) { var indexWhereFound = -1; for (var position = 0; position < numberArray.length; position = position + 1) { if (numberArray[position] == number) { indexWhereFound = position; } } return indexWhereFound; } //ARRAYS that represent the board -- you do not need to change these //array of special squares var specialSquaresArray = [1,7,25,32,39,46,65,68,71,77]; //array of corresponding squares the player ascends or descends to var connectedSquaresArray = [20,9,29,13,51,41,79,73,35,58]; //VARIABLES used -- you do not need to change these //the square the player is currently on var playersPosition; //play is initially at START playersPosition = 0; //what they score when they roll the die var playersScore; //the index of the player's position in the special squares array or -1 var indexOfNumber; //MAIN PROGRAM //TODO add code here for parts (iii), (iv)(b), (v), and (vi) // start of question(iii) playersScore = rollDie(); document.write(' Sco ' + playersScore); playersPosition = playersScore + playersPosition; document.write(', Squa ' + playersPosition); indexOfNumber = findIndexOf(playersPosition, specialSquaresArray); if (indexOfNumber != -1) { document.write(', Ladder to Squa ' + connectedSquaresArray[indexOfNumber]); playersPosition = connectedSquaresArray[indexOfNumber]; indexOfNumber = -1; } document.write('<BR>') // end of question(iii) // start of question(iv)(b) while(playersPosition<=80) { playersScore = rollDie() document.write(' Sco ' + playersScore) playersPosition = playersPosition + playersScore document.write(', Squa ' + playersPosition) indexOfNumber = findIndexOf(playersPosition, specialSquaresArray) if(indexOfNumber != -1) { document.write(', Ladder to Squa ' + connectedSquaresArray[indexOfNumber]); playersPosition = connectedSquaresArray[indexOfNumber]; } document.write('<BR>'); } var countMoves = 0; while(countMoves <= 0) { document.write('You took ' + countMoves + ' moves to get out'); countMoves = countMoves + 1 } /*for (var countMoves = 0; countMoves < playersPosition; countMoves = countMoves + 1) { countMoves = countMoves + playersPosition; document.write('You took ' + countMoves + ' moves to get out'); }*/ // end of question(iv)(b) // start of question (v) /*if (playersPosition >=80) { document.write('The player is out'); }*/ // end of question (v) </SCRIPT> </HEAD> <BODY> </BODY> </HTML> Many thanks. is there a way to make a javascript <br/> ??
i have a program which gets values from different arrays and displays them on screen. how do i insert a break every 5 lines so its easier to read?
Hello! =) I am using tinybox2 to make a modal window, which now I have loading correctly. =) thank you! the modal window loads as an iframe, but I have two image links inside the modal window. One I'd like to open in a new window (i got that one!), the other image I'd like to be treated the same as the X button and have it close the modal window. this is the body onload in the main document Code: <body onload="TINY.box.show({iframe:'modal.html',boxid:'frameless',width:750,height:450,fixed:false,maskid:'bluemask',maskopacity:70,closejs:function(){closeJS()}})"> <script language="JavaScript1.2">mmLoadMenus();</script> these are two lines for closing in the CSS file Code: .tclose {position:absolute; top:0px; right:0px; width:30px; height:30px; cursor:pointer; background:url(images/close.png) no-repeat} .tclose:hover {background-position:0 -30px} Thanks once again in advance! carrie |