[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => chuck145 [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 3 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > > > > > > test_images > > > > > > > > >
> > hspace="20" vspace="30" name="ball_1" width="40" height="40" > id="ball_1"/> > > width="40" height="40" id="ball_2"/> > >
> > > >[/quote] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Murray *ACE* [ip] => forums@HAHAgrea [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 4 [islastshown] => 1 [isfirstshown] => [attachments] => [allattachments] => ) --> 2 images in layer, always move in sync - Macromedia Dynamic HTML

2 images in layer, always move in sync - Macromedia Dynamic HTML

I have been testing some javascript to move images within a layer. (<div> tag) I have 2 images in the layer and I change the hspace and vspace of only one, they both move as though stuck together, Can this behaviour be prevented....

  1. #1

    Default 2 images in layer, always move in sync

    I have been testing some javascript to move images within a layer. (<div> tag)
    I have 2 images in the layer and I change the hspace and vspace of only one,
    they both move as though stuck together,

    Can this behaviour be prevented.


    chuck145 Guest

  2. #2

    Default Re: 2 images in layer, always move in sync

    I have no idea what you just said - why not post a link to the page?

    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
    [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
    ==================


    "chuck145" <webforumsusermacromedia.com> wrote in message
    news:elklck$jvh$1forums.macromedia.com...
    >I have been testing some javascript to move images within a layer. (<div>
    >tag)
    > I have 2 images in the layer and I change the hspace and vspace of only
    > one,
    > they both move as though stuck together,
    >
    > Can this behaviour be prevented.
    >
    >

    Murray *ACE* Guest

  3. #3

    Default Re: 2 images in layer, always move in sync

    Sorry if I was not clear,

    I am attaching the code - the page is not on the web

    There are 2 images in the layer
    When the first image is clicked, the javascript code moves the first image -
    but why does the second image move ?
    :smile;

    <!--This page is for testing the movement of an image -->
    <!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; cht=iso-8859-1" />

    <title>test_images</title>

    <script type="text/javascript">

    var imgvar
    var y_jump = 6
    var x_jump = 6


    function checkmove()
    {
    imgvar = window.event.srcElement

    img_y_now = imgvar.vspace
    img_x_now = imgvar.hspace


    imgvar.vspace = img_y_now + y_jump
    imgvar.hspace = img_x_now + x_jump
    }


    </script>

    <style type="text/css">

    #Head_layer {
    position:absolute;
    left:71px;
    top:19px;
    width:732px;
    height:240px;
    z-index:2;
    border: thin inset #660033;
    }

    </style>
    </head>
    <body>


    <div id="Head_layer">

    <img src="a_basketball.gif" onclick="checkmove('ball_1')"
    hspace="20" vspace="30" name="ball_1" width="40" height="40" id="ball_1"/>

    <img src="a_basketball.gif" hspace="200" vspace="200" name="ball_2"
    width="40" height="40" id="ball_2"/>

    </div>

    </body>
    </html>

    chuck145 Guest

  4. #4

    Default Re: 2 images in layer, always move in sync

    Images are inline elements - this means that they will be placed
    horizontally adjacent on a line (provided the container is wide enough to
    accommodate this. Your layer is 732px wide, image1 is 40px wide +20*2
    spacing = 80px total width, and image2 is 40px wide + 200*2 spacing = 440px
    total width.

    Your javascript is directly altering the hspace assigned to image1, causing
    it to occupy less total effective width. As that happens, image2 moves left
    since it will always want to abut image1.

    Geddit?

    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
    [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
    ==================


    "chuck145" <webforumsusermacromedia.com> wrote in message
    news:elkp3q$o44$1forums.macromedia.com...
    > Sorry if I was not clear,
    >
    > I am attaching the code - the page is not on the web
    >
    > There are 2 images in the layer
    > When the first image is clicked, the javascript code moves the first
    > image -
    > but why does the second image move ?
    > :smile;
    >
    > <!--This page is for testing the movement of an image -->
    > <!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; cht=iso-8859-1" />
    >
    > <title>test_images</title>
    >
    > <script type="text/javascript">
    >
    > var imgvar
    > var y_jump = 6
    > var x_jump = 6
    >
    >
    > function checkmove()
    > {
    > imgvar = window.event.srcElement
    >
    > img_y_now = imgvar.vspace
    > img_x_now = imgvar.hspace
    >
    >
    > imgvar.vspace = img_y_now + y_jump
    > imgvar.hspace = img_x_now + x_jump
    > }
    >
    >
    > </script>
    >
    > <style type="text/css">
    >
    > #Head_layer {
    > position:absolute;
    > left:71px;
    > top:19px;
    > width:732px;
    > height:240px;
    > z-index:2;
    > border: thin inset #660033;
    > }
    >
    > </style>
    > </head>
    > <body>
    >
    >
    > <div id="Head_layer">
    >
    > <img src="a_basketball.gif" onclick="checkmove('ball_1')"
    > hspace="20" vspace="30" name="ball_1" width="40" height="40"
    > id="ball_1"/>
    >
    > <img src="a_basketball.gif" hspace="200" vspace="200" name="ball_2"
    > width="40" height="40" id="ball_2"/>
    >
    > </div>
    >
    > </body>
    > </html>
    >

    Murray *ACE* Guest

Similar Threads

  1. Move layer to mouse location
    By Geo in forum Dreamweaver AppDev
    Replies: 0
    Last Post: April 29th, 10:47 AM
  2. move objects to new layer
    By Gethin_Coles@adobeforums.com in forum Adobe Illustrator Windows
    Replies: 3
    Last Post: August 2nd, 11:23 AM
  3. Move objects to current layer
    By Bruce Kieffer in forum Macromedia Freehand
    Replies: 3
    Last Post: February 3rd, 02:42 AM
  4. Move Object to Current Layer
    By Bruce Kieffer in forum Macromedia Freehand
    Replies: 5
    Last Post: November 3rd, 12:46 AM
  5. Move and resize object in layer
    By Lee Clayton in forum Adobe Photoshop & Illustrator
    Replies: 2
    Last Post: July 16th, 11:39 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •