www.webdeveloper.com
Results 1 to 2 of 2

Thread: [RESOLVED] Popup box on mouseover

  1. #1
    Join Date
    Oct 2009
    Posts
    8

    resolved [RESOLVED] Popup box on mouseover

    Hi,

    I have previously used some code to display a popup box when a person mouses over a hyperlink. I'm trying to use a similar technique while building a html table as a string within javascript (based on dynamic data).

    I've enclosed an example of the kind of thing I'm trying to do here, but can anyone please tell me why the mouseover/mouseout isn't showing and hiding the content of the popup?

    Many thanks for any suggestions or advice.

    Gary
    Code:
    <html>
    <head>
    </head>
    <body>
    	<div id="SpecAssignOC" style="display:none; position:absolute; border-style: solid; background-color: #FFCC66; 
          padding: 5px; left:501px; top:1054px; visibility:visible; width:100px;  height:160px; z-index:1" align="center">
    <font size="2">This is on call data</font> 
    </div>
    
    <Script type="text/JavaScript">
    
    function HideContent(d) {
    if(d.length < 1) { return; }
    document.getElementById(d).style.display = "none";
    }
    function ShowContent(d,rset,uset) {
    if(d.length < 1) { return; }
    var dd = document.getElementById(d);
    AssignPosition(dd,rset,uset);
    dd.style.display = "block";
    }
    
    function specassigncells() {
    if (tarr[5]=='')
    {str+='<td>&nbsp;</td>';}
    else 
    {str+='<td><font color="#FF0000"><a onmouseover="ShowContent('+'"SpecAssignOC"'+'650,500); return true;" onmouseout="HideContent('+'"SpecAssignOC"'+'); return true;"  href="javascript:ShowContent(\'SpecAssignOC\')">*</font></td>';}
    if (tarr[6]=='')
    {str+='<td>&nbsp;</td>';}
    else 
    {str+='<td><font color="#00FF00">*</font></td>';}
    }
    
    
    var StringRecs ='Name, Unit, Scale, Day, Duty, OCS, DOS, OCE, DOE, OCT, DOT|'
    
      StringRecs = StringRecs + 'Person 1,1B Sergeants,Sergeant,22-11-2011,23:00-07:00,,|'
      StringRecs = StringRecs + 'Person 1,1B Sergeants,Sergeant,23-11-2011,22:00-07:00,,|'
      StringRecs = StringRecs + 'Person 1,1B Sergeants,Sergeant,24-11-2011,22:00-07:00,,|'
      StringRecs = StringRecs + 'Person 1,1B Sergeants,Sergeant,25-11-2011,RD,23:00,|'
      StringRecs = StringRecs + 'Person 1,1B Sergeants,Sergeant,26-11-2011,RD,,|'
      StringRecs = StringRecs + 'Person 1,1B Sergeants,Sergeant,27-11-2011,RD,,|'
      StringRecs = StringRecs + 'Person 1,1B Sergeants,Sergeant,28-11-2011,16:00-00:00,,|'
      StringRecs = StringRecs + 'Person 2,1M Part Time - Constable,Sergeant,22-11-2011,RD,,|'
      StringRecs = StringRecs + 'Person 2,1M Part Time - Constable,Sergeant,23-11-2011,07:00-15:00,,|'
      StringRecs = StringRecs + 'Person 2,1M Part Time - Constable,Sergeant,24-11-2011,DIVOP,,07:00|'
      StringRecs = StringRecs + 'Person 2,1M Part Time - Constable,Sergeant,25-11-2011,AL,,|'
      StringRecs = StringRecs + 'Person 2,1M Part Time - Constable,Sergeant,26-11-2011,RD,,|'
      StringRecs = StringRecs + 'Person 2,1M Part Time - Constable,Sergeant,27-11-2011,RD,,|'
      StringRecs = StringRecs + 'Person 2,1M Part Time - Constable,Sergeant,28-11-2011,07:00-15:00,,07:00|'
      StringRecs = StringRecs + 'Person 3,1A Inspector,Inspector,22-11-2011,07:00-17:00,07:00,|'
      StringRecs = StringRecs + 'Person 3,1A Inspector,Inspector,23-11-2011,RD,,|'
      StringRecs = StringRecs + 'Person 3,1A Inspector,Inspector,24-11-2011,RD,,|'
      StringRecs = StringRecs + 'Person 3,1A Inspector,Inspector,25-11-2011,21:00-07:00,,|'
      StringRecs = StringRecs + 'Person 3,1A Inspector,Inspector,26-11-2011,21:00-07:00,,|'
      StringRecs = StringRecs + 'Person 3,1A Inspector,Inspector,27-11-2011,21:00-07:00,,|'
      StringRecs = StringRecs + 'Person 3,1A Inspector,Inspector,28-11-2011,RD,,|'
    
    var Recs = StringRecs.split('|');
    var tarr = [];
    var str = '';
    str += '<table id="opTable25007" class="example table-autosort:0 table-stripeclass:alternate" border="1">';
    tarr = Recs[0].split(',');
    harr1 = Recs[1].split(',');
    harr2 = Recs[2].split(',');
    harr3 = Recs[3].split(',');
    harr4 = Recs[4].split(',');
    harr5 = Recs[5].split(',');
    harr6 = Recs[6].split(',');
    harr7 = Recs[7].split(',');
      str += '<thead><tr align="left"><th class="table-sortable:default">'+tarr[0]+'</th><th class="table-sortable:default">'
          + ['Unit','Scale',harr1[3],'c','d',harr2[3],'c','d',harr3[3],'c','d',harr4[3],'c','d',harr5[3],'c','d',harr6[3],'c','d',harr7[3],'c','d'].join('</th><th class="table-sortable:default">')+'</th></tr></thead><tbody>';
      for (var i=1; i<Recs.length-1; i=i+7) {
        str += '<tr CLASS="PortletText1">';
        tarr = Recs[i].split(',');
        str += '<td>'+tarr[0]+'</td><td>'+tarr[1]+'</td><td>'+tarr[2]+'</td>';  str += '<td>'+tarr[4]+'</td>';
    	specassigncells() 
        tarr = Recs[i+1].split(',');    str += '<td>'+tarr[4]+'</td>';
    	specassigncells()
        tarr = Recs[i+2].split(',');    str += '<td>'+tarr[4]+'</td>';
    	specassigncells()
        tarr = Recs[i+3].split(',');    str += '<td>'+tarr[4]+'</td>';
    	specassigncells()
        tarr = Recs[i+4].split(',');    str += '<td>'+tarr[4]+'</td>';
    	specassigncells()
        tarr = Recs[i+5].split(',');    str += '<td>'+tarr[4]+'</td>';
    	specassigncells()
        tarr = Recs[i+6].split(',');    str += '<td>'+tarr[4]+'</td>';
    	specassigncells()
        str += '</tr>';
      }
      str += '</tbody></table>';
    document.write(str) ;
    </script>
    </HTML>

  2. #2
    Join Date
    Oct 2009
    Posts
    8
    Resolved the problem myself by using some alternative 'tooltip' onmouseover code from http://dynamicdrive.com/dynamicindex5/fixedtooltip.htm
    Last edited by Low Society; 11-25-2011 at 12:58 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center

"

"

X vBulletin 4.2.2 Debug Information

  • Page Generation 0.26064 seconds
  • Memory Usage 2,862KB
  • Queries Executed 15 (?)
More Information
Template Usage (33):
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (2)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (73):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates