Jump to content

yandoo

Members
  • Posts

    472
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

yandoo's Achievements

Advanced Member

Advanced Member (4/5)

1

Reputation

  1. Hiya I was wondering how I can edit my nav menu so that nav menu for the current page changes: I just want it so it is the same as when it is hovered over but i just cant seem to work out how to implement it. If I create a new class and assign it to the nav menu manually and I can change the font color but not the background color or border? <li class="selected">My Travels</li> Any ideas? Thank you #nav, .nav, #nav .nav li { margin:0px; padding:0px; font-family: Arial; font-weight:600;} #nav li {float:left; display:inline; cursor:pointer; list-style:none; padding:5px 20px 5px 20px;border-radius:10px; position:relative; background: rgba( 0,0,0, 0.7);border:1px solid #FDD017;margin-left:5px;} #nav li ul.first {left:-1px; top:100%;} li, li a {color:#FDD017; text-decoration:none; font-size:16px} #nav .nav li { width:100%; text-indent:10px; line-height:30px; margin-right:10px; border-top:1px #000 solid; border-left:none; border-right:none; background:#757547;} #nav li a {display:block; width:inherit; height:inherit;} ul.nav { display:none; } #nav li:hover > a, #nav li:hover { color:#000; background:#FDD017; } li:hover > .nav { display:block; position:absolute; width:250px; top:-2px; left:50%; z-index:1000; border:1px #000 solid; } li:hover { position:relative; z-index:2000; }
  2. Hi all, I was wondering if someone might be able to help me. I'm using html5 video on my website. The problem is that the poster will not show. After sometime of trying to work out why I discovered it was because the background of my webpage has a image. If I remove the image the poster displays but simply will not with a background image on my body tag. Does anybody know a work around to get it to work please? Thank you body { height:100%; background-image:url(images/bg4.jpg); background-repeat:repeat-y; background-attachment:fixed; } <video width="400" height="267" controls preload="none" poster="videos/posters/poster.png">
  3. Thank you very much for your reply, Yes I totally see what you mean now with database structure. I'm just a little unsure about retrieving that data. By joining both House and map/neighbour table I would know the house details and its coordinates. But how would I know which house is next to the first house? Could you elaborate a little please? Thank you
  4. Hiya, I am trying to make a game using php/mysql. This a version 2 with many improvements but a complete redesign and change in rules. I've been contemplating in my tiny brain and limited knowledge exactly how to solve a specific problem. I will try and explain what I am trying to achieve (in order to try and keep it simple I am explaining in terms of houses on a grid but in fact its planets, see attachment.) I have a database with a table (only mentioning relevant one) that contains details of a house. I have a grid map divided evenly into 8 squares by 15 squares. Within many of these squares (not all) is a house. From any starting house I wish display a path to any other house. A condition of making this path is that a house must be 1 square away from another. (so moving across the map would require you to hop over each house 1 square away and so on. You can't hop more than 1 square and if there isn't a house next to the house your hopping from you cant move there) For example as long as every hop to another house along the path is is owned by you, you can anywhere. Displaying a path (which is css and html) is easy. But working out which each allowed hop is where the mysql and php come in. I have tried various ways to achieve this but don't think any of them is very good. The latest method is find each house that is 1 square away from the departure house. Then find those houses that are 1 square away from those houses and so on. So I thought nesting while loops could achieve this and creating a new table to store information of a house and its neighbour house. For example table called neighbour and inserting a record for each house that is 1 square away from another house. ID House1 (departure house) House2 (neighbour house) Creating a simple query to establish where the 1 square away houses are from the departure house Next I create a nested do while loop to echo out all the houses within 1 square away from each other: $house = 'Frist House'; mysql_select_db($database_swb, $swb); $test = "SELECT House2 FROM neighbour WHERE House1='$house' AND "; $test = mysql_query($test, $swb) or die(mysql_error()); $row_test = mysql_fetch_assoc($test); $totalRows_test = mysql_num_rows($test); do{ echo $row_test['Name2']; echo'<br/>'; $nexthouse = $row_test['Name2']; mysql_select_db($database_swb, $swb); $test1 = "SELECT Name2 FROM neighbour WHERE Name1='$nexthouse'"; $test1 = mysql_query($test1, $swb) or die(mysql_error()); $row_test1 = mysql_fetch_assoc($test1); $totalRows_test1 = mysql_num_rows($test1); do{ echo $row_test1['Name2'];echo'<br/>'; } while ($row_test1 = mysql_fetch_assoc($test1)); } while ($row_test = mysql_fetch_assoc($test)); This method starts with the first house , searches for other houses 1 square away. With the houses it finds it then searches for other houses that are 1 square away from that. As you can see this probably is a very poor method of trying to achieve this. If I haven't explained very well please see the attachment image of the map and houses (planets) so you can see what I'm trying to achieve. Do you know of anyother better way I can do this please?? Thank you for listening.
  5. Thank you very much for all your replies. Sorry for my late reply, the weather knocked out the power. Thank you
  6. Thank you for your reply, I actually lost the db after i reinstalled my o/s and can't find the .sql. I noticed in the notes file i have many .mno files, they look like they could be of some use. The task is so mammoth though and manually will take ages to analyse and rebuild the appropriate structure.
  7. Hiya I know this is probably a long shot but is there a programme or something out there that can use to search my .php pages to identify the structure of its related database? I lost my .sql file and the only way to restore the structure of the db at this point is to manually go through each .php page to identify and re-create the structure. Thank you
  8. I think i've done just that by modifying the meta and adding a couple of more.. <meta name="viewport" content="initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,width=device-width,height=device-height,target-densitydpi=device-dpi,user-scalable=yes" /> <meta name="viewport" content="initial-scale=1.0,width=device-width,user-scalable=0" /> <meta name="viewport" content="initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,width=device-width,user-scalable=no" />
  9. Thank you for your reply. The issue was I forgot the meta tag. This has brought up another issue though, if I view the page in medium zoom (default) on my smart phone the page doesnt fit right yet again.. Is there away i can automatically set distance as far and make it so it is not changable? Thank you
  10. Hiya I'm trying to create different styles for different devices i.e smart phones (landscape/portrait) and desktops. I'm using: /* LANDSCAPE STYLES */ @media only screen and (min-width : 321px) /* DESKTOP STYLES */ @media only screen and (min-width : 800px) And i will also be (but not yet as problems getting landscape styles to be called) using: /* PORTRAIT STYLES */ @media only screen and (max-width : 320px) The wierd thing is that when I browse the website using my smart phone in lanscape mode (zoomed out) The landscape styles are never called and instead the desktop style is. I've checked on a few websites and this is apparently the write screen/pixel with: 320px portrait and 480px landscape. Why is it that the desktop styles are used on my smart phone and not the landscape style???? If any body could help that would be ace. Heres the code: /* LANDSCAPE STYLES */ @media only screen and (min-width : 321px) { #workshop1{ width: 30%; height: 60%; min-width: 0; color: #ffffff; font-size: 9px; font-weight:bold; border-radius:20px; float:left; } #image{ width: 100%; height: 100%; min-width: 0; height:100%; padding-top: 5px; margin: auto; } #description{ width: 90%; height: 140px; word-spacing:-1px; color: #ffffff; font-size: 9px; font-weight: normal; text-align: justify; position: relative; } #detail { width: 80%; min-width: 0; height:38px; word-spacing:-1px; text-align: center; position: absolute; bottom: 10%; } #workshop2{ width: 30%; height: 60%; min-width: 0; color: #ffffff; font-size: 9px; font-weight:bold; border-radius:20px; float:left; margin-left:5%; }} /* DESKTOP STYLES */ @media only screen and (min-width : 800px) { #workshop1{ width: 216px; height:360px; background-color: #028ec1; border-radius:25px; padding-top: 5px; float:left; overflow: hidden; color: #ffffff; font-size:14px; font-weight:bold; } #image{ width: 216px; height:135px; padding-top: 5px; margin: auto; } #description{ width: 200px; height:180px; padding-left: 10px; padding-right: 10px; padding-top: 5px; word-spacing:-1px; color: #ffffff; font-size: 13px; text-align: justify; position: relative; font-weight: normal; } #detail{ width: 193px; height:50px; word-spacing:-1px; text-align: center; position: absolute; bottom: 0px; } #workshop2{ width: 216px; height:360px; background-color: #028ec1; border-radius:25px; padding-top: 5px; float:left; margin-left:20px; color: #ffffff; font-size:14px; font-weight:bold; }} Thank you very much
  11. Hiya I can't get my 2 divs to sit next to each other. Instead the 2nd one is below the first (although with space between then if they were side by side) Heres the css: #wrapper{ width: 800px; float: left; border: 1px solid; margin: auto; } #workshop1{ width: 300px; height:420px; background-color: #028ec1; border-radius:25px; padding-top: 5px; float: left; } #image1{ width: 300px; height:188px; padding-top: 5px; } #description1{ width: 280px; height:160px; padding-left: 10px; padding-right: 10px; padding-top: 5px; word-spacing:-1px; color: #ffffff; font-size: 13px; text-align: justify } #workshop2{ width: 300px; height:420px; background-color: #028ec1; border-radius:25px; padding-top: 5px; margin-left: 400px; float: left; } #image2{ width: 300px; height:188px; padding-top: 5px; } #description2{ width: 280px; height:160px; padding-left: 10px; padding-right: 10px; padding-top: 5px; word-spacing:-1px; color: #ffffff; font-size: 13px; text-align: justify } If anybody could help that would be ace. Thanks
  12. I fixed it by: ul.enlarge{ list-style-type:none; /*remove the bullet point*/ margin-right:-40px; } This has made it so there is harldy any gap between each photo and I still don't understand why I would need to use -40px in the margin. Thanks
  13. Hiya I'm really stuck on trying to get an unordered list to appear in my table cell correctly (the unordered list is coded so that when an image is hovered over a larger one appears - this aspect works fine). It doesn't seem to fit, it makes the table wider than it should be, its not centered, it overlaps the edge of the table and theres too much of a gap between each image (see screenshot attachement). I've tried adjusting the padding and margins but it doesn't change anything. Any ideas on how I can make this work correctly please? html/php <td width="250" height="250" valign="top" style="border:solid; border-color:#D1D0CE; border-width:1px;"><ul class="enlarge"><li><img src="inventory_images/' . $id . '_list.jpg" alt="' . $product_name . '" /><span><img src="inventory_images/' . $id . '_small.jpg" alt="' . $product_name . '" /></span></li></ul><p class="SmallText" align="center"> '.$details.'<center><form id="form1" name="form1" method="post" action="cart.php"><input type="hidden" name="pid" id="pid" value='.$id.' /><input type="submit" value="" name="button" id="button" class="cardbutton" /></form></center></p></td> css ul.enlarge{ list-style-type:none; /*remove the bullet point*/ margin-right:0px; } ul.enlarge li{ display:inline-block; /*places the images in a line*/ display:inline; position: relative; z-index: 0; /*resets the stack order of the list items - later we'll increase this*/ margin:0px 0px 0 0px; } ul.enlarge img{ background-color:#eae9d4; padding: 6px; -webkit-box-shadow: 0 0 6px rgba(132, 132, 132, .75); -moz-box-shadow: 0 0 6px rgba(132, 132, 132, .75); box-shadow: 0 0 6px rgba(132, 132, 132, .75); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } ul.enlarge span{ position:absolute; left: -9999px; background-color:#eae9d4; padding: 5px; font-family: 'Droid Sans', sans-serif; font-size:.9em; text-align: center; color: #495a62; -webkit-box-shadow: 0 0 20px rgba(0,0,0, .75)); -moz-box-shadow: 0 0 20px rgba(0,0,0, .75); box-shadow: 0 0 20px rgba(0,0,0, .75); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius:4px; } ul.enlarge li:hover{ z-index: 50; cursor:pointer; } ul.enlarge span img{ padding:2px; background:#ccc; } ul.enlarge li:hover span{ top: -300px; /*the distance from the bottom of the thumbnail to the top of the popup image*/ left: -20px; /*distance from the left of the thumbnail to the left of the popup image*/ } ul.enlarge li:hover:nth-child(2) span{ left: -100px; } ul.enlarge li:hover:nth-child(3) span{ left: -200px; } /**IE Hacks - see http://css3pie.com/ for more info on how to use CS3Pie and to download the latest version**/ ul.enlarge img, ul.enlarge span{ behavior: url(pie/PIE.htc); } Thank you very much.
  14. Thank you very much, that's solved my problem and elevated my level of understanding.
  15. Hiya I have database records that are outputted in a table column for each record. I want to make it so that when every 5 records are outputted and new row is created and then another 5 column records are outputted and so on. I can't get my head around this and have attempted to create a maximum record count. if ($productCount > 0) { while($row = mysql_fetch_array($sql4)){ $id = $row["id"]; $product_name = $row["product_name"]; $price = $row["price"]; $category = $row["category"]; $details = $row['details']; $date_added = strftime("%b %d, %Y", strtotime($row["date_added"])); $maxCount = 5; if ($productCount != $maxCount) { $dynamicList .= '<td width="150"><a href="inventory_images/'.$id.'.jpg" target="_blank"><img style="border:#666 1px solid;" src="inventory_images/' . $id . '_small.jpg" alt="' . $product_name . '" border="1" width="150"/></a> '.$details.'£'.$price.' <form id="form1" name="form1" method="post" action="cart.php"><input type="hidden" name="pid" id="pid" value='.$id.' /><input type="submit" value="" name="button" id="button" class="cardbutton" /></form></td>'; } else if ($productCount == $maxCount) { $dynamicList .= '<td width="150"><a href="inventory_images/'.$id.'.jpg" target="_blank"><img style="border:#666 1px solid;" src="inventory_images/' . $id . '_small.jpg" alt="' . $product_name . '" border="1" width="150"/></a> '.$details.'£'.$price.' <form id="form1" name="form1" method="post" action="cart.php"><input type="hidden" name="pid" id="pid" value='.$id.' /><input type="submit" value="" name="button" id="button" class="cardbutton" /></form></td></tr><tr>'; } Needless to say it doesn't work and just outputs all the records in a single row. So I guess the else if ($productCount == $maxCount) never happens. Any ideas on how i can get this to work please? Thank you very much. Tom
×
×
  • 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.