Jump to content

Maknib

Members
  • Posts

    43
  • Joined

  • Last visited

    Never

About Maknib

  • Birthday 04/15/1982

Contact Methods

  • Website URL
    http://www.markknibbs.com

Profile Information

  • Gender
    Male
  • Location
    Brisbane

Maknib's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi guys, i am taking the Javascript course from Learnable.com (sitepoint). we have come up to Objects in Javascript.. he has stated something like: var MyObject = { init: function(){ //do stuff }, something: function(){ //do something else } }; MyObject.init(); he has said that i need to put myObject.init(); on the bottom as the object hasn't been created yet if i try to call it from the top.. i'm gathering that this is similar to.. public class MyObject{ public void init(){ //do stuff } public void something(){ //do something else } } i'm wondering, because i'm starting to get used to working with classes and a Main class... can i have all my objects declared in another JS file, and use an include or an import in another "main" js file? purely for neatness? as i would like to have all funtions / objects in one file and the workings of the script in another. is this possible in Javascript? hope this makes sense thanks
  2. hi guys, i am wondering if the below link is correct? i would like to learn HTML5 but this says to me that we shouldn't use it yet as it's not fully supported. http://html5accessibility.com/
  3. hi guys hoping you can help.. i have a container with 2 divs inside of it. ithe right div inside stretches 100% but the left div will not. a screenshot can be seen here: http://imageshack.us/f/88/sitegr.png/ I have tried all i can think of with min heights and 100% heights but i can't get that left have nav to stretch all the way... Any help please!?? i have added red and blue to show the divs.. Blue: #main-gallery red: #gallery-images dark-grey: #pages The CSS #main-gallery{ background: blue; height: 100%; padding-bottom: 50px; border-top: 1px solid #222222; } #pages{ float: left; width: 120px; border-right: 1px solid #222222; text-align: left; padding-left: 10px; padding-top: 10px; font-family: arial; color: #fff; font-size: 14px; background: #2D2D2D; } #gallery-images{ background: red; float: right; width: 700px; padding-top: 10px; margin-left: 10px; } HTML <div id="main-gallery"> <div id='pages'> <ul> <?php while ($row = mysql_fetch_array($result)){ ?> <li><a href="gallery.php?view=<?php echo $row['page']; ?>">+ <?php echo $row['page']; ?></a></li> <?php } ?> </ul> </div> <div id="gallery-images"> <div id="image-list"> <?php while ($row = mysql_fetch_array($images)){ ?> <a href="images/pictures/<?php echo $row['image_name']; ?>" rel="lightbox" Title=" Title: <?php echo $row['title']; ?> <br /> width: <?php echo $row['width']; ?><br/> height: <?php echo $row['height']; ?>" alt=""> <img src = "images/pictures/<?php echo $row['image_name']; ?>" /> </a> <?php } ?> </div> </div> <div class='clear'></div> </div><!-- end main -->
  4. ahh ok so <style> img { width: 300px; } </style> is fine but.. <img src="" style="width: 300px;" /> is out
  5. thanks, i was thinking of that but i thought inline was frowned upon a bit.
  6. is itpossible to have php in an external css file? so my user could change the background color? something like.. body{ background: <?php $color; ?> } if it is would the .css file need to be a .css or .php cheers
  7. in my assignmetn we are using php to make a simple shopping cart, we are not allowed to use a database for this but instead storing into files. the part i have come up to is: Would this all be done with Sessions? and once submitted then all the session variables are saved to file? i can't get my head around this one thanks
  8. i haven't done that yet i need to get someone with admin rights to install WAMP for me. Ok im getting WAMP.. so this sql query will count each member and then tell me how many occurences of that member number there are? so if the data is 123 123 123 123 154 154 154 it will return something like... 123 = 4, 154 = 3 ? or just 4 3 ??
  9. i haven't done that yet i need to get someone with admin rights to install WAMP for me.
  10. ok i just used a Unique filter in excel and got myself from 8037 rows to 3800 now it looks like this, so all i need to do is be able to count how many times each member number appears... is that easy and doable? 000088 2007 000088 2008 000088 2009 000115 2009 000115 2010 000350 2011 000482 2004 000482 2005 000482 2006 000482 2007 000495 2010 000821 2010 001789 2009 001911 2006 001911 2009 001911 2011
  11. Thanks i was hoping for something like saving it as a .csv importing into a database and them some sort of query and loop . can't figure the formula.. something so it would make an array maybe with Array['memberNumber] => year and then looping through and counting like.. there's 4 occurances of member 12345 and only 2 unique years so the answer is 2. but i'm probably dreaming and will have to manually count.
  12. Hi guys, wondering if you can help me. i've been given a task at work in Excel and it is going to take me a long time in excel so i'm wondering if there's a PHP script i can create for this... basically the data i have looks like below on the left is the member numbers and on the right is the year they claimed... i need to find how many years each member has claimed.. so if member 12345 has years 2005 2007 2008 they have claimed 3 years. but if they have 2005 2005 2005 2007 2007 2008 2008 they still have 3 years.. can this be done simple some how? there is about 8000+ cells i need to go through manually counting. 014134 2009 014134 2009 014134 2009 014330 2010 014572 2006 014573 2008 014604 2010 014604 2010 014667 2004 014667 2005 014667 2006 014667 2006 014667 2006 014667 2006 014667 2007 014667 2007
  13. Maknib

    Classes

    Classes are blueprints. say an architect makes a blueprint for a house and wants to create 50 of them houses.. he is not going to 50 separate blueprints for the same house. say you're making a game, you make a player that can jump swim walk run and attack. 2 months later you make another game with a player that does the exact same thing. are you going to want to rewrite the code or simple use a class that already exists. so your player class has methods call jump swim walk attack...etc. all you would need to do is something like (this is not php code..) New player = New PlayerClass(); now to get him to jump you would do.. player.jump(); or.. if(player touches water){ player.swim(); } and so on not sure with PHP but something like Actionscript or Java if you want to round 23.34 down you would type Math.floor(23.34); Math is a abstract class and floor is the method of the class... if there were no classes you would have to create the code to do this every time you needed it. if you are starting out do not dive straight into classes and oop until you have a strong feel and understanding of the code... im still learning myself so most of this is probably wrong
  14. you just broke my brain! too late in the arvo for this. hehe
×
×
  • 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.