Page 1 of 6 123 ... LastLast
Results 1 to 10 of 55

Thread: Scroll photos into view once selection made

  1. #1
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,291
    Thanks
    166
    Thanked 3 Times in 3 Posts

    Default Scroll photos into view once selection made

    Hi,
    Here is the site in question.
    https://www.theremotedoctor.co.uk/photogallery.html

    On the Pc all is good so this is aimed at the mobile phone market.

    This is what happens / would like to happen.
    The user can see various option titles, BIRDS, CATTLE, DEER etc etc.
    The selection is made example DEER now the deer images should scroll into view thus the option titles moving to
    the top of the screen.

    Currently when the title is selected the user then needs to manually scroll to bring the photos into view.


    See my attached photos to show before title selected & then what should happened is relation to page scrolling up.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	9FCF7038-94EF-400C-A29B-5FF00FB9F937.jpg 
Views:	344 
Size:	12.5 KB 
ID:	6570   Click image for larger version. 

Name:	35D735F4-509C-4400-8482-79200F9DC07B.jpg 
Views:	344 
Size:	14.0 KB 
ID:	6571  

  2. #2
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    2,432
    Thanks
    5
    Thanked 290 Times in 283 Posts

    Default

    Hi there theremotedr,

    I am sorry for the long delay in replying to your post.

    Unfortunately, as forum coding problems become more and more infrequent
    I find that my little grey cells take longer to solve those that come my way.

    This one of yours, as you can see, took me a long time to find a possible
    solution for you to try.

    Check out the attachment to see best and only answer that I am able to
    provide for you

    coothead.
    Attached Files Attached Files
    ~ the original bald headed old fart ~

  3. #3
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    2,432
    Thanks
    5
    Thanked 290 Times in 283 Posts

    Default

    Hi there theremotedr,

    use the attached javascript file in place of the existing.

    coothead
    Attached Files Attached Files
    Last edited by coothead; 12-21-2022 at 09:18 AM.
    ~ the original bald headed old fart ~

  4. #4
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,291
    Thanks
    166
    Thanked 3 Times in 3 Posts

    Default

    I have today managed to log in.
    The issue mentioned is as follows as to what i have noticed.

    Post #2 js file works fine.

    Post #3 you advise to use this js file.
    Please advise what changes were made & what it was supposed to do.

    I ask because changing & using the js file in post #3 i see the issues mentioned.

    The main header image "Me & my dog" is not shown.
    I click example "DEER" & the Deer photos are now loaded / shown but as soon as i scroll on the phone ALL the photos are now loaded.
    So for example 20 Deer were loaded.
    I slightly scroll.
    All the photos from AIRCRAFT, BIRDS, BUDDY, CATTLE etc etc have replaced the Deer.

  5. #5
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    2,432
    Thanks
    5
    Thanked 290 Times in 283 Posts

    Default

    Hi there theremotedr,

    I have looked at you link in post#1 and see that you using this javascript...
    Code:
    function styleChange(){
    if( document.body.offsetWidth>544){
        document.querySelector('.reload-btn').classList.add( 'hide' );
        filterSelection('all');  
        document.querySelector('.reload-btn').classList.add( 'hide' );
     }
     
    else { document.querySelector('.reload-btn').classList.remove( 'hide' );
           c='';
           filterSelection(c);
           document.querySelector('#myBtnContainer').style.top = 0;
           document.querySelector('.header-container').classList.add( 'hide' );
           document.querySelector('.h2text').classList.add( 'hide' ); 
     }
    }
    The lines in red need to be removed.

    coothead
    ~ the original bald headed old fart ~

  6. #6
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,291
    Thanks
    166
    Thanked 3 Times in 3 Posts

    Default

    Hi,
    I have deleted the red text as mentioned.
    Please can you check that all is ok.

  7. #7
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    2,432
    Thanks
    5
    Thanked 290 Times in 283 Posts

    Default

    Hi there theremotdr,

    almost there, now add the two lines in red as shown here...
    Code:
    function styleChange(){
    if( document.body.offsetWidth>544){
        document.querySelector('.header-container').classList.remove( 'hide' );
        document.querySelector('.h2text').classList.remove( 'hide' );
        filterSelection('all');  
     }

    coothead
    ~ the original bald headed old fart ~

  8. #8
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,291
    Thanks
    166
    Thanked 3 Times in 3 Posts

    Default

    Sorry for delay but server down most of day.
    I have now replaced the red text as advised but please explain what is supposed to happen ?

    Like before still if I click Deer I see Deer but if I scroll a very small
    Amount the deer is replaced with all of the images.

  9. #9
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    2,432
    Thanks
    5
    Thanked 290 Times in 283 Posts

    Default

    Hi there theremotedr,

    I have just checked out your site and I am not seeing the
    implementation of the javascript modification in post #7.

    coothead
    ~ the original bald headed old fart ~

  10. #10
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,291
    Thanks
    166
    Thanked 3 Times in 3 Posts

    Default

    I will add it again now.

    I did remove it but I suppose I should of left it for you to see.

Similar Threads

  1. Replies: 2
    Last Post: 09-07-2017, 04:53 PM
  2. Replies: 0
    Last Post: 06-01-2009, 12:10 PM
  3. Replies: 4
    Last Post: 11-01-2008, 12:42 AM
  4. Iframe scroller made to have manual scroll mouse over ...etc.
    By Girard Ibanez in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 11-20-2006, 12:11 AM
  5. Document selection then view
    By Silent Panther in forum PHP
    Replies: 1
    Last Post: 10-18-2005, 01:16 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
  •