Jump to content

sofian

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sofian's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thank you man very much . wen i add your code the script stop to work . sorry ... please forget from this . i will stay as it as . thank you for your help
  2. thank you very much for your help . but realy i dont want to change the code , i just want to add to the code the option wen click on the page (evry were) hide the div . thank you please not that i dont have any know with php or scripts .
  3. hi i have this code that wen i click on div1 show div2 , wen click again on div1 hide div2 , but wen div2 is show and click on another place on the page it not hide ..... can you please help me to make it wen click on any place on the page hide dive2 too!! <script> $(document).ready(function(){ $("#div1").click(function(e) { e.preventDefault(); if ($("#div2").is(":visible")) { $("#div2").hide(); } else { $("#div2").show(); } }); }); </script> thanks
  4. first sorry and thank you for this note . and sorry about my bad english . in fact i have adropdown menu wen click on "menu" the div show , wen click on "menu" again the dive hide . but i want to make the script hide the div wen click anywere on the page , (for now wen click anywere on the page not hide ). do you understand me now ? thank you
  5. hi every one i have ascript that wen clik show a div , wen click again (just on the same place were clicked before) the div hide . i want to make it wen click anywere on the page hide this div . this is the script : <script> $(document).ready(function(){ $("#dropmenu").click(function(e) { e.preventDefault(); if ($("#menupobout").is(":visible")) { $("#menupobout").hide(); } else { $("#menupobout").show(); } }); }); </script> the div : <div id="menustyle" > <ul style="position:absolute" id="menupobout"> <li id="menustyleavatar"> <table border="0" > <tr> <td width="55px" valign="top"> '.avatar($client,80).' </td> <td > '.url('u/'.$client['username'],$client['username']).' </td> </tr> </table> </li> '.url('u/'.$client['username'],t(my page)).' </ul> </div> and this is the css style : #menustyle ul { background-color: #FFFFFF; border-bottom: 2px solid #2D4486; border-left: 1px solid #333333; border-right: 1px solid #333333; border-top: 1px solid #333333; margin-right: 5px; margin-top: -1px; min-width: 200px; padding-bottom: 5px; padding-left: 0; padding-right: 12px; padding-top: 10px; position: absolute; /* right: 0; */ /* top: 100%;*/ right: 5px; z-index: 1; display: none; text-align: right; } #menustyle ul a, #menustyle ul a:visited { color: #4366AD; font-weight: normal; text-align: right; } #menustyle li { display: block; float: none; } #menustyleavatar { border-bottom: 1px solid #E0E0E0; margin-bottom: 5px; margin-top: 5px; margin-left: 4px; margin-right: 4px; min-height: 55px; padding-bottom: 0; padding-left: 14px; padding-right: 0px; padding-top: 0; position: relative; } i hop any one help me thank you
  6. thank you punk_runner for this help and reply i cant use $newArr = array_reverse($arr); because i need the comment_display function and this code asort($arr); i tryed it but the result not change . thank you verry much
  7. thank you cyberRobot for your help and reply . i tryed to use from here http://php.net/manual/en/array.sorting.php but i did not succes . but here all the code that i have for the comments : 1- the script : <script> $(".quick_comment").click(function() { $(this).next().next().css("display","block"); $(this).next().next().find(".commentmessage").focus(); return false; }); $(".commentsubmit").click(function() { if ($(this).prev()[0].value != "") { var thiscomment = $(this).parents(".quick_comment_form"); var cbox = thiscomment.next().next(); var mbox = thiscomment.find(".commentmessage"); var tbox = thiscomment.next(); cbox.html("<img src=\"'.uhome().'/files/loading.gif\" /> Submitting"); $.post("'.uhome().'/index.php?p=jquery/comment_publish", {message:mbox[0].value,target_id:tbox[0].value}, function(data){ cbox.html(""); $(".quick_comment_form").css("display","none"); cbox.after(data); mbox.attr("value",""); },"html" ); return false; } }); </script> 2- the jquery code : ( function comment_publish ) $arr = array( 'avatar'=>$client['avatar'],'message'=>stripslashes($_POST['message']),'username'=>$client['uname'],'created'=>time() ); echo comment_display($arr); 3- function comment_display function comment_display($row = array()) { if (!$row['avatar']) { $res = sql_query("select avatar from ".tb()."accounts where id='{$row['uid']}'"); $row2 = sql_fetch_array($res); if (!$row2['avatar']) $row['avatar'] = 'undefined.jpg'; else $row['avatar'] = $row2['avatar']; }; return ' <div class="user_comment"> <table width="100%"> <tr> <td class="user_post_left" width="40" valign="top">'.avatar($row,25).'</td> <td class="user_post_right" valign="top"> <strong>'.url('u/'.$row['username'], $row['username']).'</strong> '.h($row['message']).' <div class="att_bottom">'.get_date($row['created']).'</div></td> </tr> </table> </div> '; } thank you verry much
  8. hi i have this code on my script : $arr = array( 'avatar'=>$client['avatar'],'message'=>stripslashes($_POST['message']),'username'=>$client['uname'],'created'=>time() ); echo comment_display($arr); if i submited 4 comments of echo comment_display($arr); start from post 1 it sort them like this : post 4 post 3 post 2 post 1 post 1 , post 2 above post 1 , post 3 above post 2 , post 4 above post 3 but i want them like this : post 1 post 2 post 3 post 4 post 1 , post 2 under post 1 , post 3 under post 2 , post 4 under post 3 how can i make the " echo comment_display($arr); " become under the last post not above . thank you verry much
×
×
  • 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.