Jonnie Grieve Digital Media: Blog

Home
by on 9th March, 2021 - 4:54pm (0)

Blog: R6D79: #100DaysOfCode (More Posts)

Today’s update for 100DaysOfCode Day 79, Round 6.

https://landing.jonniegrieve.co.uk/photo_viewer_2/

If you press the left and the right buttons on your keyboard, you will be able to cycle between the 4, (currently) images available as stored in a multidimensional array.  I haven’t found a way to make the data react the same way yet. But this is progress.  I still don’t know if I’ve completely gotten passed the bug with the event object yet.  If I pass event in as a parameter,  the slides do not work.  Which suggests to me there’s still a problem with deprecaton of the event object.

function show($index) {

        //console.log(event.keyCode);

        if( event.keyCode == 39 ) {

            $index++;

        }

        if( event.keyCode == 37 ) {

            $index--;

        }

        return $index;

    }

But if I just don’t pass the parameter in, it’s fine, and it starts to work.  There’s still the issue as well of tracking the $index value so it doesnt go out of bounds of the multidimensional array. But I am so happy with what I have now managed to achieve.

There’s still more to follow via Daily Tuition’s Tutorial  so I’m looking forward to finishing that and finding a way to paginate the image data below.

I also found the time to make a tiny change to my portfolio in which brought the status icon next to the portfolio tittle above the fold, so people can see at a glance the status of that project rather than having to scroll to see it.

This post has been assigned to the following categories

    Leave a Reply

    Your email address will not be published. Required fields are marked *