Drawing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cleary1981
    New Member
    • Jun 2008
    • 178

    Drawing

    Hi All,

    I want to pick your brains a bit here.

    I have a database of objects with attributes such as height and width. I am trying to design a page where I can generate these objects from a dropdown list and assign them a name. They will then appear on screen in a specified location and from there will be draggable around the screen. The drag and drop I can do no problem. What format is best to use for the objects themselves? SVG, image maps, DIVs, or what do you think?
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    As far as I understand, you should use DIVs. Provide the style as position:absolu te;... left, top, height, width and backgroundColor as saved in the database. DIVs can be easily dragged and dropped, no problem there too. Once dragged, you can update the new position or height/width to the database by ajax may be on a click of a button.

    Would that solve the issue or are there any other features?

    Comment

    • cleary1981
      New Member
      • Jun 2008
      • 178

      #3
      Divs works for most of the problem. Im going to try just using img with an id tag for now because the actual image itself is not really important. I can drag and drop them ok and generating them from a database is possible.

      Comment

      • cleary1981
        New Member
        • Jun 2008
        • 178

        #4
        I don't suppose you know is it possible for me to use variables to define the height and width of an image?

        <img id="object" src="box.gif" height="50px" width="100px">

        Comment

        • hsriat
          Recognized Expert Top Contributor
          • Jan 2008
          • 1653

          #5
          Originally posted by cleary1981
          I don't suppose you know is it possible for me to use variables to define the height and width of an image?

          <img id="object" src="box.gif" height="50px" width="100px">
          What sort of variables are they?
          I would still say, you should use divs. But again its your exact requirement which should be considered for the final choice.

          Comment

          • cleary1981
            New Member
            • Jun 2008
            • 178

            #6
            I want to be able to specify the height and width foe every different instance. I know this can be done using javascript. Im just going to have to take a crash course in javascript again to work it out. Thanks

            Comment

            • hsriat
              Recognized Expert Top Contributor
              • Jan 2008
              • 1653

              #7
              This may help you.

              Comment

              Working...