Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    3
    Member #
    36263
    Hello !

    My website is here:
    http://raasiku2.vabavara.ee/kruntide-plaanid/

    I made a map and if you click on it, new window pops up with information. That is great, managed to get it to work somehow.

    Now the problem is, how do I link that when you click on a map also table row below gets highlighted.


    If you could help me with this one, I would be very very grateful!

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    I'd add a class to each of the map areas (call it "area-click") and then have a jQuery click function defined for it. Then I'd read the classes for the area that was clicked, do some string manipulation to get the associated ID, and add my CSS accordingly.

    Unfortunately, there isn't an easier way I can think of to explain it than that.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    The site's in Wordpress - that might be hard to do.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  5. #4
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    That's why I think he'll have to build a jQuery outside of WP. It's doable, but it's going to take a bit of thinking.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  6. #5
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    I see that somehow there are links in the map, although they don't seem to show when I look at the code.
    If he can figure out a way to add a class to each link in the map, then some custom CSS could do it.
    For example <a class="map-section">link here</a> in the html
    and then .mapsection a:hover {background: whatever highlight you want;} in the CSS
    50cali8er likes this.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  7. #6
    Junior Member
    Join Date
    May 2013
    Location
    New York
    Posts
    6
    Member #
    36204
    Hi,

    You can change css to hover. I don't know whether it would work or not as your site is in wordpress. You can try out.

  8. #7
    Junior Member
    Join Date
    May 2013
    Posts
    3
    Member #
    36263
    Hey Managed to get partly work. Got help outside. Code is here. However I want now to make it also Vice Versa. If you hover on a row, the map part goes active. How to do it. I am really a beginner.

    raasiku2.vabavara.ee/kruntide-plaan

    Code:
    <script type="text/javascript">
    jQuery(document).ready(function($) {
        $("area").mouseover(function(){
            //console.log($(this));
            //var FirstClass = $(this).attr('class').split(' ')[0];
            //var Num = FirstClass.split('-').last();
            //console.log(FirstClass);
            //console.log(Num);
            var KeyNum = $(this).attr("data-mapster-key");
            //console.log(KeyNum);
            if (KeyNum == 0) {
                $("#tablepress-1 .row-1").addClass("rowActive");
            }
            else if (KeyNum == 1){
                $("#tablepress-1 .row-2").addClass("rowActive");
            }
            else if (KeyNum == 11){
                $("#tablepress-1 .row-6").addClass("rowActive");
            }
            else if (KeyNum == 12){
                $("#tablepress-1 .row-8").addClass("rowActive");
            }
            else if (KeyNum == 2){
                $("#tablepress-1 .row-4").addClass("rowActive");
            }
            else if (KeyNum == 10){
                $("#tablepress-1 .row-10").addClass("rowActive");
            }
            else if (KeyNum == 3){
                $("#tablepress-1 .row-3").addClass("rowActive");
            }
            else if (KeyNum == 9){
                $("#tablepress-1 .row-12").addClass("rowActive");
            }
            else if (KeyNum == 4){
                $("#tablepress-1 .row-5").addClass("rowActive");
            }
            else if (KeyNum == 8){
                $("#tablepress-1 .row-13").addClass("rowActive");
            }
            else if (KeyNum == 5){
                $("#tablepress-1 .row-7").addClass("rowActive");
            }
            else if (KeyNum == 6){
                $("#tablepress-1 .row-9").addClass("rowActive");
            }
            else if (KeyNum == 7){
                $("#tablepress-1 .row-11").addClass("rowActive");
            }
        });
        $("area").mouseout(function(){
            $("#tablepress-1 tr").removeClass("rowActive");
        });
    });
    </script>
    <style type="text/css">
    .rowActive td {
        background-color: #c18ed3 !important;
    }
    </style>

  9. #8
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Code:
    $("#tablepress-1 tr").hover(function() {
      // add your removal and adding of the rowActive class here.
    });
    50cali8er likes this.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  10. #9
    Junior Member
    Join Date
    May 2013
    Posts
    3
    Member #
    36263
    Im sure it would help If i would be smarter at area of coding. hehe
    where can i find my removal and how to define rowActive and where do I find that. Sorry if you pros are facepalming


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:37 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com