Jump to content

Canman2005

Members
  • Posts

    669
  • Joined

  • Last visited

    Never

Posts posted by Canman2005

  1. the code looks like

     

    var x_offset_tooltip = 5;
    var y_offset_tooltip = 0;
    
    var ajax_tooltipObj = false;
    var ajax_tooltipObj_iframe = false;
    
    var ajax_tooltip_MSIE = false;
    if(navigator.userAgent.indexOf('MSIE')>=0)ajax_tooltip_MSIE=true;
    
    
    function ajax_showTooltip(externalFile,inputObj)
    {
    if(!ajax_tooltipObj)	/* Tooltip div not created yet ? */
    {
    	ajax_tooltipObj = document.createElement('DIV');
    	ajax_tooltipObj.style.position = 'absolute';
    	ajax_tooltipObj.id = 'ajax_tooltipObj';		
    	document.body.appendChild(ajax_tooltipObj);
    
    
    	var leftDiv = document.createElement('DIV');	/* Create arrow div */
    	leftDiv.className='ajax_tooltip_arrow';
    	leftDiv.id = 'ajax_tooltip_arrow';
    	ajax_tooltipObj.appendChild(leftDiv);
    
    	var contentDiv = document.createElement('DIV'); /* Create tooltip content div */
    	contentDiv.className = 'ajax_tooltip_content';
    	ajax_tooltipObj.appendChild(contentDiv);
    	contentDiv.id = 'ajax_tooltip_content';
    
    	if(ajax_tooltip_MSIE){	/* Create iframe object for MSIE in order to make the tooltip cover select boxes */
    		ajax_tooltipObj_iframe = document.createElement('<IFRAME frameborder="0">');
    		ajax_tooltipObj_iframe.style.position = 'absolute';
    		ajax_tooltipObj_iframe.border='0';
    		ajax_tooltipObj_iframe.frameborder=0;
    		ajax_tooltipObj_iframe.style.backgroundColor='#FFF';
    		ajax_tooltipObj_iframe.src = 'about:blank';
    		contentDiv.appendChild(ajax_tooltipObj_iframe);
    		ajax_tooltipObj_iframe.style.left = '0px';
    		ajax_tooltipObj_iframe.style.top = '0px';
    	}
    
    
    }
    // Find position of tooltip
    ajax_tooltipObj.style.display='block';
    ajax_loadContent('ajax_tooltip_content',externalFile);
    if(ajax_tooltip_MSIE){
    	ajax_tooltipObj_iframe.style.width = ajax_tooltipObj.clientWidth + 'px';
    	ajax_tooltipObj_iframe.style.height = ajax_tooltipObj.clientHeight + 'px';
    }
    
    ajax_positionTooltip(inputObj);
    }
    
    function ajax_positionTooltip(inputObj)
    {
    var leftPos = (ajaxTooltip_getLeftPos(inputObj) + inputObj.offsetWidth);
    var topPos = ajaxTooltip_getTopPos(inputObj);
    
    var tooltipWidth = document.getElementById('ajax_tooltip_content').offsetWidth +  document.getElementById('ajax_tooltip_arrow').offsetWidth; 
    
    ajax_tooltipObj.style.left = leftPos + 'px';
    ajax_tooltipObj.style.top = topPos + 'px';	
    
    }
    
    
    function ajax_hideTooltip()
    {
    ajax_tooltipObj.style.display='none';
    }
    
    function ajaxTooltip_getTopPos(inputObj)
    {		
      var returnValue = inputObj.offsetTop;
      while((inputObj = inputObj.offsetParent) != null){
      	if(inputObj.tagName!='HTML')returnValue += inputObj.offsetTop;
      }
      return returnValue;
    }
    
    function ajaxTooltip_getLeftPos(inputObj)
    {
      var returnValue = inputObj.offsetLeft;
      while((inputObj = inputObj.offsetParent) != null){
      	if(inputObj.tagName!='HTML')returnValue += inputObj.offsetLeft;
      }
      return returnValue;
    }

  2. Hi all

     

    I have a tooltip script and I'm getting an error

     

    ajax_showTooltip is not defined

     

    though firebug.

     

    if I look at the scripts function, I get

     

    function onclick(event) {
    ajax_showTooltip("contentdeletebox.php?id=109", this);
    return false;
    }

     

    the HTML im using to kick off that javascipt function is

     

    <a onClick="ajaxLoader('content.php?edit=<?php print $row['id']; ?>','content');">click</a>

     

    It works fine locally on my computer, but when uploaded to its home server, the error appears and the tooltip is disabled with only that error to go on.

     

    any ideas anyone?

     

    thanks

  3. Hi all

     

    I have a field called `expiry_date` and I want to run a QUERY that grabs all records where there is 5 or less months left until the `expiry_date` has been reached.

     

    Does that make sense? Can anyone help?

     

    Thankd very much

     

    Ed

     

     

  4. I have tried using

     

    $exploded = explode(",", "$rr");
    $rand = rand(1, count($exploded));
    echo $exploded[$rand];

     

    which kinda works, it displays a random number, but sometimes returns nothing (although it could be 0 it's returning)

     

    any ideas why it would do that?

  5. Hi all

     

    I have the following

     

    if(getramdoms(2) != 0)
    {
    $rr = $rr. '1,';
    }
    if(getramdoms(44) != 0)
    {
    $rr = $rr. '2,';
    }
    if(getramdoms(99) != 0)
    {
    $rr = $rr. '3,';
    }
    if(getramdoms(132) != 0)
    {
    $rr = $rr. '4,';
    }
    
    print $rr;
    

     

    which produces something like

     

    1,3,4,

     

    My question is, how can I randomly pick one of those values and set the random value as

     

    $randomnumber = ?

     

    any help would be great as im totally stumped

     

    thanks very much for any help

  6. Hi all

     

    I have a table called `members` which looks like

     

    id

    user_id

    type

     

    I want to do a simple

     

    SELECT `user_id` FROM `members` WHERE `type` = 'J'

     

    My question is.

     

    How can I get the QUERY do the ORDER BY most popular, using the `user_id` and LIMIT it by 3

     

    So if there are

     

    9 rows with `user_id` value set as 3

    28 rows with `user_id` value set as 7

    2 rows with `user_id` value set as 13

    55 rows with `user_id` value set as 18

     

    then the QUERY would return `user_id` in the following order

     

    `user_id`

    18 (as it has 55 rows)

    7 (as it has 28 rows)

    3 (as it has 9 rows)

     

    Any help would be great, been hunting for an answer for the last 4 hours with no luck

     

    thanks very much in advance

     

    dave

  7. Hi all

     

    I have 2 tables, one called `users` which looks like

     

    id

    name

     

    and the other table called `user_list` which looks like

     

    id

    user_id (this field ties into the field `id` in the `users` table)

    type

     

    how can I do the following

     

    1: select all rows from `users`

    2: but ignore any rows from the `users` table if they appear in `user_list` (under `user_id`) and also have the `type` set to the value "X"

     

    Sorry, hard to explain, hope it makes some sense

     

    Any help would be great

     

    thanks

     

    dave

×
×
  • 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.