Jump to content

ferret147

Members
  • Posts

    55
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

ferret147's Achievements

Member

Member (2/5)

0

Reputation

  1. If you look at this code it gets the left coordinate of the div tag - http://jsfiddle.net/JuPA4/ which is pretty much what I need. I am using a program on the Mac called Hype, it is like flash but all HTML 5, my demonstration is here - http://snooker-magazine.co.uk/phpfreaks/black.html (I have asked on the Hype forums and have had no answer for 3 days now) The black dot element is within a div tag called #black for some reason the code posted above does not work with the hype file! I know I can interact with it and I have added a demonstration to the page click Hide / Show to interact with the dot. I am not the best with Javascript so if anybody has any ideas then the help would be appreciated. There is a zip file in the parent folder with all the files if anybody needs them. The end result of this is that the coordinates for both left and top are updated to a text input so I can place them into a database.
  2. I admire your confidence I will have a bash at this for sure but I am not that confident of doing it myself but again thank you for pointing me in the right direction.
  3. !!! Nothing to do with physics, it is a drawing application the balls do not move at all, you place the balls on the stage and draw lines from the balls depicting their path.
  4. Yeah sure I know where you are coming from it has taken me enough time to get PHP under my belt
  5. Cheers Guys I wil look into it further down the jQuery route but my Javascript knowledge is limited and my only real HTML5 experience has been using Hype to do simple motion tweening and transitions. But if any of you or anybody reading this want to drop me a PM with a quote I am listening. I would not need all of the features just the basic drop balls, draw lines and have a unique URL for posting in a vBulletin forum, I have all of the graphics required already as I have been doing tutorials using Hype already.
  6. Would you think that the application demonstrated in this video would be easy to replicate in HTML5 and Javascript? http://pool.bz/Demo-Video.php
  7. Quick question! I have tried to use the readfile() and the fopen commands to fetch the files in the now protected folder with no luck! Any advice? What I done is setup a test folder and page; /index.php /protected/ /protected/.htaccess htaccess file is as suggested and works fine and redirects to index.php in the index.php file I have this; <?php $file = ''/protected/testimage.jpg'; ?> <p><img src="<?php fopen("$file", "r");?>" /></p> and the image does not show! any ideas as to how I should fetch the file? I was thinking of cURL but I have used this function in the past and it is very CPU heavy and this script is going to be servicing around 41,000 page views a day form the members.
  8. Right ok I think I understand now. Thank you for your help guys.
  9. I see what you are saying but my problem is a little more complex! lets say I have a file in site.com/admin/files/file.avi this would not stop a member copying that URL from the page it is embedded in, posting it up on a message board or sharing it with someone via email who does not have a user account on the site and them accessing the file hence the reason for only allowing browsers with that session set being allowed to access the file. Unless there is another way but I can not think of anything off hand
  10. I have been told that I can use mod_rewrite to deny folder access from a session variable but as of yet am unable to find any confirmed evidence of this. Basically this is what I am wanting to do; admin/ admin/files I have the admin folder protected with a login script and when members log in I want them to have access to the folder admin/files but if a visitor is not logged in then they will be denied access to admin/files/ my session variable is $admin_username So in the .htaccess I suppose I am looking for something like this - if (issset($_SESSION['admin_username'])) {/allow} else {/deny} well that is how I would do it in php but how can I achieve this with mod_rewrite ? All help appreciated, this one has been bugging me for some time now.
  11. I am still stuck on this if anybody can help me out?
  12. Thanks nogray that works really well. One last question, is it possible to put the player data into a array! Basically there will be 32 player names which will replace the player1, player2 etc To give you an idea of what I am doing here is the dev page I am working on - LINK
  13. I done that and still no joy, do you think it would be a problem with the double class's I am using!
  14. Hi nogray, thanks for you help, I implemented the changes you suggested but could not get it to work! You will have to forgive me but the closes I get to working with javascript is adding a behavior in Dreamweaver Here is the code with changes; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Snooker Brackets</title> <style type="text/css"> .base { background-color: #CF6; height: 50px; width: 400px; } .player1 { background-color: #000; height: 50px; width: 400px; color: #FFF; } .player2 { background-color: #fff; height: 50px; width: 400px; } .player1over { background-color: #009; height: 50px; width: 400px; color: #FFF; } .player2over { background-color: #C9C; height: 50px; width: 400px; } .class { background-color: #C9C; height: 50px; width: 400px; } </style> <script> function change_class(player, class){ var my_ids = ['_div1', '_div2']; for (var i=0; i<my_ids.length; i++){ document.getElementById(player+my_ids[i]).className = class; } } </script> </head> <body style="margin: 0pt;"> <div class="base" id="player_div1" onmouseover="player1.className='player1over';" onmouseout="player1.className='player1'">Player 1</div> <div class="base" id="player_div1" onmouseover="player2.className='player2over';" onmouseout="player2over.className='player2'">Player 2</div> <div class="base player1" id="player1_div2">Player 1</div> <div class="base player2" id="player2_div2">Player 2</div> <div class="base player1" id="player1_div3">Player 1</div> <div class="base player2" id="player2_div3">Player 2</div> <div class="base player1" id="player1_div4">Player 1</div> <div class="base player2" id="player2_div4">Player 2</div> <div class="base player1" id="player1_div5">Player 1</div> <div class="base player2" id="player2_div5">Player 2</div> <div class="base player1" id="player1_div6">Player 1</div> <div class="base player2" id="player2_div6">Player 2</div> </body> </html>
  15. I have been racking my brains for days over this and trying everything I know but as of yet nothing works for what seems to be such a says task. I have two Div's and when I hover over them I want the class of other divs to change, easy for the div you are currently hovering over but not if you are not hovering!! OK Here is the code I have mocked up; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Snooker Brackets</title> <style type="text/css"> .base { background-color: #CF6; height: 50px; width: 400px; } .player1 { background-color: #000; height: 50px; width: 400px; color: #FFF; } .player2 { background-color: #fff; height: 50px; width: 400px; } .player1over { background-color: #009; height: 50px; width: 400px; color: #FFF; } .player2over { background-color: #C9C; height: 50px; width: 400px; } </style> </head> <body style="margin: 0pt;"> <div class="base player1" onmouseover="player1.className='player1over';" onmouseout="player1.className='player1'">Player 1</div> <div class="base player2" onmouseover="player2.className='player2over';" onmouseout="player2over.className='player2'">Player 2</div> <div class="base player1">Player 1</div> <div class="base player2">Player 2</div> <div class="base player1">Player 1</div> <div class="base player2">Player 2</div> <div class="base player1">Player 1</div> <div class="base player2">Player 2</div> <div class="base player1">Player 1</div> <div class="base player2">Player 2</div> <div class="base player1">Player 1</div> <div class="base player2">Player 2</div> </body> </html> So when you hover over the top two divs the div's with the relating classes change class to the over state. Kets take the first Div and this code - onmouseout="player1.className='player1'" if the code was onmouseout="this.className='player1'" then the div I am hovering over the class would change with no problems, so I thought if I change this to the class I want changes across the board then it would work but no Additional information that may help - all of the values for player1 and player2 will be dynamic, this is for a bracketing system that will track a players winning path through a competition.
×
×
  • 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.