Jump to content

GuitarGod

Members
  • Posts

    93
  • Joined

  • Last visited

Everything posted by GuitarGod

  1. In messing around with my code, I've managed to fix my problem. I'm not too sure how/why it existed, but having a SPAN inside another SPAN seemed to cause the onmouseout not to function properly and making the box re-appear: <span onmouseover="document.getElementById('box').style.display='';" onmouseout="document.getElementById('box').style.display='none';">Box event <span id="box" style="position:absolute; display:none" onmouseover="this.style.display='';" onmouseout="this.style.display='none';"> <table> -- TABLE_CODE_HERE </table> </span></span> Really I should have used the code in my first post and kept the SPANs separate. Thank you for reading anyway!
  2. Hi all, I've posted this in HTML as I'm sure this is a HTML problem. I'm using SPAN and Javascript to create a floating box when an onmouseover event is triggered, and the box should close when onmouseout comes into effect (the box should stay open whilst the mouse is not only over the box triggering event, but over the box itself). This semi-works, as the floating box does appear on onmouseover, yet onmouseout, the box closes for a few milliseconds then re-opens - it should stay closed. Any ideas on this? An example of my code is as follows. <span onmouseover="document.getElementById('box').style.display='';" onmouseout="document.getElementById('box').style.display='none';">Box event</span> <span id="box" style="position:absolute; display:none" onmouseover="this.style.display='';" onmouseout="this.style.display='none';"> <table> -- TABLE_CODE_HERE </table> </span>
  3. Excellent advice, I didn't even think of doing it that way - problem solved. Cheers!
  4. Hi all, I'm creating a page with some floating DIV menus - using the position:fixed style attribute. Example: <div id="div1" style="position:fixed">some content <div id="div2" style="position:fixed">big content</div> </div> My problem is that the content in div2 is limited to the size of div1, but I thought putting the position:fixed attribute means that the content of div2 could be as big as it wanted as the div is "free" - if that makes sense? Is there any way around this? Thanks for any and all help!
  5. Worked a treat, thank you
  6. Hi everyone, I'm having a bit of trouble with something. Basically I have a JavaScript function that will load page elements such as tables and divs. Straight after this function I have some code to populate these loaded elements with data. If you can imagine: load_elements(); document.getElementById( 'element1' ).innerHTML = ... document.getElementById( 'element2' ).innerHTML = ... And so forth The problem is that the data won't populate because the elements haven't finished loading - it's fine if I put a delay on the population code, but is there any better alternative such as telling JavaScript not to execute the population code until the load_elements(); function has finished? Thanks for any and all help
  7. Using LEFT or RIGHT seems to leave me with a sytax error. It seems to point to using AND after the ON statement, could this be why?
  8. Hi everyone. I'm a query very similar to the one below with no success. Unfortunately SQLs and joins are not my strong suit. SELECT f.field1, f.field2, f.field3 FROM fields_table f WHERE f.field1 = SOME_VALUE LEFT JOIN fields_table s ON s.field2 > f.field2 AND s.field3 <= f.field3 LIMIT 1 I would like the first SELECT query to be returned even if there are no matches on the join, also I'd like the second table query to be limited to 1. Is this possible? Could anyone revise the table above to make this work? Thanks!
  9. Hi, I wasn't sure whether to post this in the MySQL forum or not as it's part of a PHP script. My apologies if this is posted in the wrong forum. I'll try to explain this as best I can, and I hope you can help I have a "comments" table. In this table, there is a "ID" and a "parent_comment" field - if the parent_comment field is set to 0, it is a main comment on the page, if it has another value, it's a reply to another comment. Example: ID: 1 | parent_comment: 0 | comment: message_here ID: 2 | parent_comment: 1 | comment: another_message ID: 3 | parent_comment: 2 | comment: another_message The second row, with a parent_comment of 1, is in reply to the first comment, and the last comment is in reply to the second comment - bare in mind there could be an unlimited number of replies to replies. What I have so far is something like <?php $sql = '??'; // This will select comments with a parent ID of 0 while (?? ) { $sql = '??'; // This will select replies to that comment while (??) { // Another SQL to get comments with a parent ID of 2 } } ?> As you can see, I have 2 SQLs and while loops, but I really need a system to get an infinite number of replies. Is there a way to do this - perhaps even in just 1 SQL statement? Thanks!
  10. I used the e modifier and it seems to work. Thanks a lot! I'm creating some basic software with a friend and we like to keep all code original.
  11. Hi, I'm trying to create a simple BB code-type function, but I'm having trouble putting a function within preg_replace. Let me show you what I mean: $bb_search = array ( '/\[b\]/', '/\[\/b\]/', '/\[img\=(.*?)\]/', ); $bb_replace = array ( '<b>', '</b>', check_image( '\\1' ), ); return preg_replace( $bb_search, $bb_replace, $text_string ); The first two (b and /b) work fine, even the function is recognised, but using \\1 doesn't put the bbcode value as the function value. I know that probably made no sense - I'm terrible at explaining these things, so sorry. If anyone can understand what I mean, even offer a solution, that would be great! Cheers!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.