Jump to content

alejandro52

Members
  • Posts

    87
  • Joined

  • Last visited

    Never

Everything posted by alejandro52

  1. // Get a style property (name) of a specific element (elem) function getStyle( elem, name ) { // If the property exists in style[], then it's been set // recently (and is current) if (elem.style[name]) return elem.style[name]; // Otherwise, try to use IE's method else if (elem.currentStyle) return elem.currentStyle[name]; // Or the W3C's method, if it exists else if (document.defaultView && document.defaultView.getComputedStyle) { // It uses the traditional 'text-align' style of rule writing, // instead of textAlign name = name.replace(/([A-Z])/g,"-$1"); name = name.toLowerCase(); // Get the style object and get the value of the property (if it exists) var s = document.defaultView.getComputedStyle(elem,""); return s && s.getPropertyValue(name); // Otherwise, we're using some other browser } else return null; } This is some code to get the style of an element independent of the browser .How can i change it to set the style of an element. I think that it would be good to make some sticky topics on functions that are widely in use for bypass differences in browsers or sites that already have some of them.
  2. The getStyle doesn't work.In the support forums it says i need the IE_loader.js.Where I can find that?
  3. I'm trying to create a dynamic menu but there are some dom elements that don't work with firefox. can someone show what dom elements i have to change to work for both? Here is the code <script LANGUAGE = "JAVASCRIPT"> function loading(){ var i; var d; for (i=1;i<8;i++){ var d=document.getElementById(i); d.style.top=i*38; } } window.onload = loading; function dropdown(id){ var img=document.getElementById('img'+id); var d_this = document.getElementById(id); var sub_menu = document.getElementById('sub'+id); if (img.alt=="down_arrow"){ move_down(id,img,d_this,sub_menu); }else if (img.alt=="up_arrow"){ move_up(id,img,d_this,sub_menu); } } function move_up(id_others,img,d_this,sub_menu){ img.src="images/down_arrow.gif"; img.alt="down_arrow"; for(i=1;i<8;i++){ if ((i)!=id_others){ if((i)>id_others){ d=document.getElementById(i); d.style.top=(i*38); } } sub_menu.style.visibility='hidden'; } } function move_down(id_others,img,d_this,sub_menu){ var hei=parseInt(sub_menu.currentStyle.height); var i; img.src="images/up_arrow.gif"; img.alt="up_arrow"; for(i=1;i<8;i++){ var img_next=document.getElementById('img'+i); var sub_next=document.getElementById('sub'+i); if ((i)!=id_others){ if(img_next!=null&&img_next.alt=="up_arrow"){dropdown(i)} if((i)>id_others){ var d=document.getElementById(i); d.style.top=i*38+hei; } } } sub_menu.style.visibility='visible'; sub_menu.style.top=parseInt(d_this.currentStyle.height)+parseInt(d_this.currentStyle.top); } </script>
  4. I added one more column in my database ro represent what i want to pass with get as a number.Couldn't figure it out the problem but i think you can't pass greek words in the browser.
  5. Hello i want to create a very simple pop up menu but yet it seems very complicated to do it. I need to do a menu like this one on the left(the green one, the web page is in greek)http://www.toniaantoniou.gr/antoniou/.Can you give me some advice on what to use so i can search i bit on this?
  6. How do i send some text in a layer with javascript?I want to display the date infront of an image I been trying this code but it doesn't seems to work <script type="text/javascript"> var d = new Date(); document.all["Layer1"].innerHTML = d; </script> and <div id="Layer1"></div>
  7. I mean when you use $row = mysql_fetch_row($result) it takes the first row and moves to the other one.when you use it again it does the same. I need to take some data from a row without moving the pointer to the next row.
  8. Is there any way to get data from a row without moving the pointer?
  9. Well, I think that there is a problem with passing greek words in the browser with Get so i used something else.
  10. does anyone have an idea on whats he problem?
  11. I have 5 buttons and i when i click them i want them to redirect to "news.php?item=. The problem is that i want to write greek in the link but when i add greek words in the item it shows -Unknown column 'ΕÏωτήσεις' in 'where clause'- (i use the item to get the rows with the item).BUT when i add one specific greek word it works perfect. When i try to change one letter from the word it shows the error message again.WTH.
  12. Ok, thx a lot for the help and for all the answers.
  13. How do i move from one row to another without using while in while($row = mysql_fetch_row($result))? when you fetch thow row and get the data from the first row and you want to move to the next data how to you move the pointer there?In java you would write row.next(). I trying gooling it but couldn't find anything.
  14. Something else.Can i add the whole article(which can be 10,000 characters long) in the article column or have a link of the article in the article column in the database and then call it from there?I was thinking the second one.If they are both possible which one is better?
  15. I also saw that the isset gets the button that was pushed to go at the new page how im going to use it with the link?
  16. how do i pass the information on the next page? I tried to look on google but everyone was saying how to use get with forms. I tried using ahref <?php while($row = mysql_fetch_row($result)) { echo '<tr>'; echo '<td>' . $row[1] . '</td>'; echo '<td>' . $row[2] . '</td>'; $link=$row[3]; echo '<td><a href="window.php?$ID=$row[1]">push me</a></td>'; echo '</tr>'; but what do i have to pass to the new window? I'll make a new connection on the new window(if im not using seesions)and sent it the id number so it can find the article i want and then display it?
  17. So the second page will be an empty page with an empty table in it where the data will be displayed?I can display the empty page, but how do i say to display the the data in the empty table?
  18. I have created the basic web page(as template in dreamweaver).You mean the code of the template?i have done that for the database <?php $connect = mysql_connect('localhost', 'user1', 'testing') or die('Could not connect: ' . mysql_error()); $db = 'test'; mysql_select_db($db) or die('Could not select database ('.$db.') because of : '.mysql_error()); $sql = "SET NAMES utf8 COLLATE utf8_bin"; mysql_query($sql) or die(mysql_error()); $query = 'SELECT * FROM erotiseis ORDER BY id DESC'; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); ?> and then in a table print the database <table width="100%" border="0" cellpadding="0" cellspacing="0" class="titles"> <!--DWLayoutTable--> <tr> <td width="106" height="17" align="left" valign="top" class="titles">date</td> <td width="339" align="left" valign="top" class="titles">describition</td> <td width="115" align="left" valign="top" class="titles">more(the link to go to)</td> </tr> <tr> <td height="8"></td> <td></td> <td></td> </tr> <?php while($row = mysql_fetch_row($result)) { echo '<tr>'; echo '<td>' . $row[1] . '</td>'; echo '<td>' . $row[2] . '</td>'; $link=$row[3]; echo '<td>' .'<a href='.$link.'>lkj</a>' . '</td>'; echo '</tr>'; } ?> </table>
  19. I want to create a simple dynamic page where when i click on a link to automatically create the page. What i mean.. I have some news that display by date, and because they will be updated every day i don't want to create a page for each one of these. So when the user goes to the index page of the news(where the news are displayed by date) and clicks on one, I want the php do all the job and create a new web page where it will add the hole text of the "new" the user selected in a page template.How do i do that? ??? Can i use the dreamweaver templates?
  20. I mean if i can read the file with fopen and display it on screen like it is saved, with all the heading fond size,bold, italic, the paragraphs.
×
×
  • 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.