Jump to content

RAZZ

Members
  • Posts

    16
  • Joined

  • Last visited

Posts posted by RAZZ

  1. Hi,I am having trouble working with the built-in math.random() function.What I need is a function that can return a good random number between two set values, or just 0 and a set value.So.. Does anyone have one?This 0-1 stuff is really confusing me.Thanks!/EDITOk, so now I have some code to go with the post. I would really appreciate some oppinions on weather or not this function will return "good" random numbers, and why - or why not.

    function rand(value){	return Math.round( Math.random()*100000 )%value;}

    Let the discussions begin..... Whadda ya say :)

  2. I have a few additions to this.First of all, you don't need the variable x.You could just do this:

    y=document.getElementByID("name").heightif(y>23){//do something}

    But even so, you might mave an other problem. The y variable may not contain the objects height value as an integer, but rather a string with "px" added to it (like "200px", for example).If you get that problem, you can fix it like this:

    x=y.slice(0,y.length-2);

    This will shave the last two characters off the string, and ad the rest to the variable x (like "200", for example).Even so, you might still get the problem that x is treated as a string, and not an integer. If you get that, you can fix it like this:

    x=eval( y.slice(0,y.length-2) );

    What eval() does is execute a string as code, so if the value of y.slice(0,y.length-2) is the string "200", it will output 200, like you had written it into the code by hand.Good luck with it!

  3. Hi,First cosider this code:

    <div style="height: 200px; width: 200px;"><img Id="anImage" src="image.jpg"/></div>

    So let's say I move the image around with java script or something.Is it possible to only make the image show if it is inside the boudaries of the div?I mean, so I will only see half the image, if I move it half way out of the div?Thank you in advance.

  4. Well, I don't have any personal experience with this, but this is what I would consider:1: What is the forum about? Who are the target users?2: Where do these people typically go, on the net and otherwise?3: What do you intend to offer them?4: Are these people already being offered the service you intend to provide? If so: What can you do better? Is your service really needed?5: Tell them about it! Use banner adds, posters, flyers, etc. to tell them what you have to offer.6: Provide the service you have promised. Be consistent and work for it. Take extra care when things are moving slow or don't go as easy as you had hoped.Also, take some time to think about what your motives are for doing this.In my experience, if my motives a pure, things usually go very easy. If my motives are self-centered, things go wrong.Good luck and have fun!

  5. Thanks guys!Scott - thanks for the link. I downloaded a software called Saint Paint Studio from that page. It looked simple from what I could see in the screen shot.mpoer - yeah, I know (and like) GIMP, but it is a huge program with far too many features for my needs. I like the price, though :)If you know of a smaller program, please let me know.justsomeguy - I have heard Paint Shop Pro mentioned on many occations, but I have never tried it. Is it a large, complicated program or a small, simple one?

  6. Hi,I need a small drawing program, that can live up to the following:-Simple interface, maybe a bit like MS paint.-Can work with .png transparency.-Can properly encode .jpg (NOT like MS paint).-has a zoom function, at least 800%.-has a color picker.-has no spy-/nag-ware.A grid-fuction and a gradient tool would also be nice, but isn't required.So basicly I need a slightly better MS paint.I am not interested in a huge program like Gimp or Photoshop, since all the extra features tends to slow down the drawing process.Thank's in advance for any suggestions!

  7. Hi,I am trying to get into this JavaScript thing, and I have what should be a really simple question:How can I extract DOM data, namely text color in RGB format, from an element?To be more precise, I have given the object a color like so:

    <html><head><script type="text/javascript">function asignColor(){	document.getElementById('txt').style.color="rgb(0,250,0)";}</script></head><body><div Id="txt" onclick="asignColor()"> This is text </div></body></html>

    So let's say that I want to change the color again, based on this information. How could I extract that?I tried searching, but I really don't have a clue about what keywords to use.Thanks alot to anyone who answers!

×
×
  • Create New...