Rollover: trying to change multiple images from oneimage - with a twist

Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default Rollover: trying to change multiple images from oneimage - with a twist

    This is a big one (for me) and hopefully there's a way to do it without too
    much trouble. What I have is a page of dynamic data that's being populated
    into a table. Part of the table generates images into one column based on a
    date in the sql db, creating a graphical representation of the data that's been
    loaded. I've got two tables on this page that relate to each other and as you
    pass over an image in one table, I have a rollover event that highlights the
    image in the other table. This is a "many to one" relationship. What I would
    like is a similar event from the other table to the initial one, creating a
    "one to many" relationship. The trouble is, each of the entries that need to
    highlight an opposing image rely on a similar name in order to recognise which
    other image needs to be highlighted. So, when you look at it from the "one to
    many" scenario, there are multiple images with the same name. This means my
    rollover does not work.

    Is there a way in which you can rollover one image and affect 'x' amount of
    other images that have the exact same name? I can't think of another way of
    doing it, can anyone else?

    Cheers!

    Streets 77 Guest

  2. Similar Questions and Discussions

    1. Rollover images
      Hello I am a student that is learning web development using Dreamweaver in an online class where there is no instructor interaction. I have been...
    2. Timed Rollover Images
      hey, im fairly new to DW so if any 1 knows the code or how to make a timed rollover it would be Helpfull :cool; Thx
    3. Image change with rollover???
      Can anyone tell me if it is possible to make an image change with mouse rollover? I am trying to make one of my buttons change to a different image...
    4. Rollover Member Change and Mac OS X/Director MX
      Hello: I am attempting to use Rollover Member Change from the library in Director MX. I build the behavior, as everything I have read seems to...
    5. Rollover Images with Templates
      I am using a template and would like the rollover state of the navigation bar to remain in the rollover state when a specific Web page is being used,...
  3. #2

    Default Re: Rollover: trying to change multiple images from oneimage - with a twist

    Sorry, I should have attached some code so you can understand what I'm saying.
    The first bit are my two recordsets and the second bit is where the dynamic
    table rows are created and where I want my rollovers to work

    <%
    var Events1 = Server.CreateObject("ADODB.Recordset");
    Events1.ActiveConnection = MM_ASP_CONNEX_STRING;
    Events1.Source = "SELECT MeetingTitle, MeetingVenue, MtgStartDate, MtgFinDate,
    mtgTitNoSpace=REPLACE(MeetingTitle,' ',''), dpYear=DATEPART(year,MtgStartDate),
    dpMonth=DATEPART(month,MtgStartDate), dpDay=DATEPART(day,MtgStartDate),
    dpYearF=DATEPART(year,MtgFinDate), dpMonthF=DATEPART(month,MtgFinDate),
    dpDayF=DATEPART(day,MtgFinDate) FROM dbo.Allmeetings WHERE
    MtgStartDate>=getDate() AND MtgStartDate<DATEADD(quarter,3,getDate())";
    Events1.CursorType = 0;
    Events1.CursorLocation = 2;
    Events1.LockType = 1;
    Events1.Open();
    var Events1_numRows = 0;
    %>
    <%
    var Activity1 = Server.CreateObject("ADODB.Recordset");
    Activity1.ActiveConnection = MM_ASP_CONNEX_STRING;
    Activity1.Source = "SELECT AcName, AcStartDate, AcFinishDate,
    MilestoneAssociation, mileAssNoSpace=REPLACE(MilestoneAssociation,' ',''),
    dpY=DATEPART(year,AcStartDate), dpM=DATEPART(month,AcStartDate),
    dpD=DATEPART(day,AcStartDate), dpYF=DATEPART(year,AcFinishDate),
    dpMF=DATEPART(month,AcFinishDate), dpDF=DATEPART(day,AcFinishDate) FROM
    dbo.Activity_tbl WHERE AcStartDate>=getDate() AND
    AcStartDate<DATEADD(quarter,3,getDate())";
    Activity1.CursorType = 0;
    Activity1.CursorLocation = 2;
    Activity1.LockType = 1;
    Activity1.Open();
    var Activity1_numRows = 0;
    %>
    <%
    var Repeat1__numRows = -1;
    var Repeat1__index = 0;
    Events1_numRows += Repeat1__numRows;
    %>
    <%
    var Repeat2__numRows = -1;
    var Repeat2__index = 0;
    Activity1_numRows += Repeat2__numRows;
    %>

    -------------

    <script type="text/javascript">
    //Set the two dates
    var startEvent =new
    Date(<%=(Events1.Fields.Item("dpYear").Value)%>,<% =(Events1.Fields.Item("dpMonth
    ").Value)%>,<%=(Events1.Fields.Item("dpDay").Value )%>)
    var finEvent =new
    Date(<%=(Events1.Fields.Item("dpYearF").Value)%>,< %=(Events1.Fields.Item("dpMont
    hF").Value)%>,<%=(Events1.Fields.Item("dpDayF").Va lue)%>)
    var dt=new Date()
    var isQu1=(dt.getMonth()==0 && dt.getDate()>0) || (dt.getMonth()==2 &&
    dt.getDate()<32)
    var isQu2=(dt.getMonth()==3 && dt.getDate()>0) || (dt.getMonth()==5 &&
    dt.getDate()<31)
    var isQu3=(dt.getMonth()==6 && dt.getDate()>0) || (dt.getMonth()==8 &&
    dt.getDate()<31)
    var isQu4=(dt.getMonth()==9 && dt.getDate()>0) || (dt.getMonth()==11 &&
    dt.getDate()<32)
    today= new Date()
    curQ=isQu1?0:isQu2?3:isQu3?6:isQu4?9:0
    curQuarter=new Date(today.getFullYear(),curQ,1)
    //Get 1 day in milliseconds
    var one_day=1000*60*60*24
    //Calculate difference btw the two dates, and convert to days
    document.write("<img src='calGraphicW.gif' height='10'
    width='"+Math.ceil((startEvent.getTime()-curQuarter.getTime())/(one_day))+"'><a
    onMouseover='z<%=(Events1.Fields.Item("mtgTitNoSpa ce").value)%>.src=\"calGraphic
    Hi.gif\"'
    onMouseOut='z<%=(Events1.Fields.Item("mtgTitNoSpac e").value)%>.src=\"calGraphic.
    gif\"';'><img src='calGraphic.gif' border='0' height='10'
    width='"+Math.ceil((((finEvent.getTime()-startEvent.getTime())/(one_day))+1)*5)+
    "' alt='<%=(Events1.Fields.Item("MtgStartDate").Value )%> -
    <%=(Events1.Fields.Item("MtgFinDate").Value)%>'
    name='x<%=(Events1.Fields.Item("mtgTitNoSpace").Va lue)%>'></a>")
    </script> </td>
    </tr>
    <%
    Repeat1__index++;
    Events1.MoveNext();
    }
    %>
    </table>?</td>
    </tr>
    <tr>
    <td height="10" bgcolor="#FFFFFF" class="gb1"><div align="right"><img
    src="default.bmp" name="quarterly">
    </div></td>
    </tr>
    <tr>
    <td height="10" bgcolor="#FFFFFF" class="gb1"></td>
    </tr>
    <tr>
    <td height="10" bgcolor="#FFFFFF" class="gb1">Activities</td>
    </tr>
    <tr>
    <td height="10" bgcolor="#FFFFFF" class="gb1"></td>
    </tr>
    <tr>
    <td height="10" bgcolor="#FFFFFF" class="gb2"><table border="0">
    <% while ((Repeat2__numRows-- != 0) && (!Activity1.EOF)) { %>
    <tr>
    <td width="150"><%=(Activity1.Fields.Item("AcName").Va lue)%></td>
    <td
    width="150"><%=(Activity1.Fields.Item("AcStartDate ").Value)%></td>
    <td width="6"></td>
    <td width="450">
    <script type="text/javascript">
    //Set the two dates
    var startEv =new
    Date(<%=(Activity1.Fields.Item("dpY").Value)%>,<%= (Activity1.Fields.Item("dpM").
    Value)%>,<%=(Activity1.Fields.Item("dpD").Value)%> )
    var finEv =new
    Date(<%=(Activity1.Fields.Item("dpYF").Value)%>,<% =(Activity1.Fields.Item("dpMF"
    ).Value)%>,<%=(Activity1.Fields.Item("dpDF").Value )%>)
    var dte=new Date()
    var isQua1=(dte.getMonth()==0 && dte.getDate()>0) || (dte.getMonth()==2 &&
    dte.getDate()<32)
    var isQua2=(dte.getMonth()==3 && dte.getDate()>0) || (dte.getMonth()==5 &&
    dte.getDate()<31)
    var isQua3=(dte.getMonth()==6 && dte.getDate()>0) || (dte.getMonth()==8 &&
    dte.getDate()<31)
    var isQua4=(dte.getMonth()==9 && dte.getDate()>0) || (dte.getMonth()==11 &&
    dte.getDate()<32)
    tod= new Date()
    cQ=isQua1?0:isQua2?3:isQua3?6:isQua4?9:0
    curQuart=new Date(tod.getFullYear(),cQ,1)
    //Get 1 day in milliseconds
    var one_da=1000*60*60*24
    //Calculate difference btw the two dates, and convert to days

    document.write("<img src='calGraphicW.gif' height='10'
    width='"+Math.ceil((startEv.getTime()-curQuart.getTime())/(one_da))+"'><a
    OnMouseover='x<%=(Activity1.Fields.Item("mileAssNo Space").Value)%>.src=\"calGrap
    hicHi.gif\"'
    OnMouseout='x<%=(Activity1.Fields.Item("mileAssNoS pace").Value)%>.src=\"calGraph
    ic.gif\"';'><img src='calGraphic.gif' border='0' height='10'
    width='"+Math.ceil((((finEv.getTime()-startEv.getTime())/(one_da))*5)+1)+"'
    alt='<%=(Activity1.Fields.Item("MilestoneAssociati on").Value)%>'
    name='z<%=(Activity1.Fields.Item("mileAssNoSpace") .Value)%>'></a>")
    </script> </td>
    </tr>
    <%
    Repeat2__index++;
    Activity1.MoveNext();
    }
    %>

    Streets 77 Guest

  4. #3

    Default Re: Rollover: trying to change multiple images from oneimage - with a twist

    Does anyone have any thoughts on this? Even a little pointer in a decent direction? I'm fresh out of ideas short of starting over again!

    Thanks.
    Streets 77 Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139