Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Split screen webpage: e.preventDefault(); works only while pressing CTRL

Split screen webpage: e.preventDefault(); works only while pressing CTRL

Scheduled Pinned Locked Moved General Discussion
5 Posts 3 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G
    G
    guillaume ark
    wrote on last edited by
    #1

    Hey everybody,
    I am struggling with something on the website I am building right now. I have a split screen and I want on one side (left side) a Project Thumbnail Grid and open the projects on the right side. For this I created a Iframe on the right side and I added this custom code to open the projects in the Iframe :

    <script>
    jQuery(document).on('click', '.thumb', function(e){ 
        e.preventDefault(); 
        var url = jQuery(this).attr('href');
        jQuery("#project-frame").attr('src', url);
    });
    </script>
    

    But I first thought that my code wasn't working, then I realized that it is working only when I press the Ctrl or Cmd while clicking on a thumbail...

    Actually it is only this part who doesn't work properly :

     e.preventDefault();  
    

    I am working on chrome but the issue also happen in firefox...
    Here is the link of the website page : [http://www.ark.amsterdam/category/projects]

    Does someone got a similar issue ? or can someone help me fixing this ?

    Thank you

    1 Reply Last reply
    0
    • mariusjopenM
      mariusjopenM
      mariusjopen
      Global Moderator
      wrote on last edited by
      #2

      Dear @guillaume-ark

      I would not use the iFrame solution.
      I would do a footer and put the projects there. Then with CUSTOM CSS I would make the split screen.

      This is way cleaner and you have a good transition.

      Best!

      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • G
        G
        guillaume ark
        wrote on last edited by
        #3

        Hey @mariusjopen
        Thank you for your answer, but I don't really get how I can load my projects in this page...

        Because what I am tyrying to do is something similar to this : (http://spectorbooks.com/)
        So that the right side of the page is kind of a project menu with all the project thumbails displayed and on the left side, make the projects pages appear.

        Is there a way to load the project pages in this page via javascript ?

        Best,
        Guillaume

        1 Reply Last reply
        0
        • mariusjopenM
          mariusjopenM
          mariusjopen
          Global Moderator
          wrote on last edited by
          #4

          Dear @guillaume-ark
          you could create a footer page and have the projects in there.

          Then with CUSTOM CSS you make the footer position fixed and width 50% and height 100vh.

          Then you have two rows.
          Of course you need to adjust the format of the gridder then.

          Hope that helps!

          Best!

          Marius

          www.mariusjopen.world

          1 Reply Last reply
          0
          • O
            O
            openair
            wrote on last edited by
            #5

            Dear @mariusjopen

            I'm interested in trying this also, and your solution sounds nicely straightforward. However, even so, I'm somehow struggling.... when I give the footer a class the footer simply disappears. Take the custom CSS out and it appears as regular, as a footer at the bottom of the page again.

            Can you help with this please? Am I entering the CSS tag in the wrong place? I'm simply right-clicking in the footer page and adding it in the add class.

            Thanks in advance,
            Sam

            1 Reply Last reply
            0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            Online Users
            I
            itsbadjujuju
            Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
            laytheme.com
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Recent
            • Tags
            • Popular
            • Users
            • Search