SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Use a Link outside a Div to Scroll the Div to the Named Anchor

    Hi,

    Using Links and Named Anchors, I have been able to have the Div scroll so that the Anchor in the Div comes into view but the page is also being scrolled even though the Div is in full view. The div has a fixed height and OVERFLOW:auto.

    Using the following javascript also causes the page to scroll.

    Code:
    href="javascript:document.getElementById('aFeaturedAds').scrollIntoView(true);"
    Is there a javascript method or function that will allow me to scroll only a specific Div when clicking on a Link or other object outside of the div.

    Thanks,
    Michael Holberton
    Hospedaje Los Jardines & Sacred Valley Mountain Bike Tours
    http://www.machawasi.com
    Cusco Database Development and Cycling Services E.I.R.L.
    http://databaseservices.blogspot.com
    Cusco Travel Services
    http://www.cusco-travel-services.com

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Well, the following functions satisfactorily in IE6 and Mozilla SeaMonkey but not in Opera 9.27. In Opera the Home Page Ads link is not working.

    Code:
    <a id=haHomePageAds href="javascript:document.getElementById('aHomePageAds').scrollIntoView(false);" runat=server>Home Page Ads</a> &nbsp;<a id=haGenAds href="javascript:document.getElementById('aGeneralAds').scrollIntoView(false);" runat=server>General Ads</a> &nbsp;<a id=haFeatured href="javascript:document.getElementById('aFeaturedAds').scrollIntoView(false);" runat=server>Featured Ads</a>
    <div id=divMain class=clsDivMissionStatement style="OVERFLOW:auto;HEIGHT:400px" runat=server>
      <a id=aHomePageAds name=HomePageAds></a>
      <h2><label id=lblHomePageAds runat=server>Home Page Ads</label></h2> <!-- add in label -->
      <asp:literal id=litHomePageAdvertising Runat= server>Advertising space is available, on our home page, for those sellers wanting to gain the immediate attention of buyers using our online services</asp:literal>.<br ><br >
      <asp:literal id=litAd35 Runat= server>For $USD35.00/month you can have a text only description that will be linked to a page from where all the details and images of your property can be seen</asp:literal>.<br ><br >
      <asp:literal id=litAd50 Runat= server>For $USD50.00/month you can also include an image or you can have a longer description</asp:literal>.<br ><br >
      <asp:literal id=litHpGen Runat= server>Your property or business will also be included in the General Advertising list or lists applicable to your property</asp:literal>.<br ><br >
      <h2><label id=lblGenAds runat=server>General Advertising</label></h2> <!-- add in label -->
      <asp:literal id=litGenAds Runat= server>For $USD15.00/month a short description and an image, of your choosing, will be displayed from which prospective buyers can link to a page from where all the details and images of your property can be seen</asp:literal>.<br ><br >
      <asp:literal id=litGenAds2 Runat= server>General advertisements will be listed by date in descending order when they satisfy the search criteria entered by Buyers</asp:literal>.<br ><br >
      <a id=aGeneralAds name=GeneralAds></a>
      <div style="PADDING-LEFT:50px">
        <h3><label id=lblFeaturedAds runat=server>Featured Ads</label></h3>
        <asp:literal id=litFeatAds Runat= server>For $USD22.50/month, your advertisements will be listed by date in ascending order at the beginning of the lists of search results when they satisfy the search criteria entered by Buyers. This will benefit those Sellers wanting to gain the immediate attention of these Buyers</asp:literal>.<br ><br >
        <a id=aFeaturedAds name=FeaturedAds></a>
      </div>
    </div>
    Can anyone advise how I can get it to work in Opera also?

    Thanks, MTB


Tags for this Thread

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
  •