javascript - Display text on mouseover - Stack Overflow

Hy there, this is what I have reached since now:<script type="textjavascript">function

Hy there, this is what I have reached since now:

 <script type="text/javascript">
 function unhide(divID) {
 var item = document.getElementById(divID);
 if (item) { 
 item.className=(item.className=='hidden')?'unhidden':'hidden'; }}
 </script>
<h3><strong><a href="javascript:unhide('Juli');"><span style="color:#000000;">Juli</span></a></strong></h3>
<div id="col2">
    <div id="Juli">
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>Von</th>
                    <th>Bis</th>
                    <th>Promoter</th>
                    <th>Strecke</th>
                    <th>Preis</th>
                    <th>Anmeldung</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>08.07.2013</td>
                    <td>08.07.2013</td>
                    <td><a href="index.php/en/events-promoters/rehm">REHM RACEDAYS</a></td>
                    <td>Imola</td>
                    <td>245,00 €</td>
                    <td><a href="">ausgebucht</a></td>
                </tr>
                <tr>
                </tbody>
        </table>
    </div>
    <h3>
        <strong><a href="javascript:unhide('August');"><span style="color:#000000;">August</span></a></strong></h3>
    <div id="col3">
        <div class="hidden" id="August">
            <table class="table table-striped">
                <thead>
                    <tr>
                                            <th>Von</th>
                        <th>Bis</th>
                        <th>Promoter</th>
                        <th>Preis</th>
                        <th>Link</th>
                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
        </div>
        <p>
            &nbsp;</p>
        <p>
            &nbsp;</p>
    </div>
</div>

and here the URL: .php/en/rennstrecken-terminenn I would like that on clicking the month the table is displayed just like it is now, and that on mouseover the month link it is displayed too. Can anyone help me? Thx

Hy there, this is what I have reached since now:

 <script type="text/javascript">
 function unhide(divID) {
 var item = document.getElementById(divID);
 if (item) { 
 item.className=(item.className=='hidden')?'unhidden':'hidden'; }}
 </script>
<h3><strong><a href="javascript:unhide('Juli');"><span style="color:#000000;">Juli</span></a></strong></h3>
<div id="col2">
    <div id="Juli">
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>Von</th>
                    <th>Bis</th>
                    <th>Promoter</th>
                    <th>Strecke</th>
                    <th>Preis</th>
                    <th>Anmeldung</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>08.07.2013</td>
                    <td>08.07.2013</td>
                    <td><a href="index.php/en/events-promoters/rehm">REHM RACEDAYS</a></td>
                    <td>Imola</td>
                    <td>245,00 €</td>
                    <td><a href="">ausgebucht</a></td>
                </tr>
                <tr>
                </tbody>
        </table>
    </div>
    <h3>
        <strong><a href="javascript:unhide('August');"><span style="color:#000000;">August</span></a></strong></h3>
    <div id="col3">
        <div class="hidden" id="August">
            <table class="table table-striped">
                <thead>
                    <tr>
                                            <th>Von</th>
                        <th>Bis</th>
                        <th>Promoter</th>
                        <th>Preis</th>
                        <th>Link</th>
                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
        </div>
        <p>
            &nbsp;</p>
        <p>
            &nbsp;</p>
    </div>
</div>

and here the URL: http://www.dieraber.altervista/index.php/en/rennstrecken-terminenn I would like that on clicking the month the table is displayed just like it is now, and that on mouseover the month link it is displayed too. Can anyone help me? Thx

Share Improve this question asked Jul 1, 2013 at 17:36 derekwikingderekwiking 11 gold badge1 silver badge1 bronze badge 3
  • The site doesn't work on Firefox BTW – Ian Clark Commented Jul 1, 2013 at 17:46
  • Sounds like you are searching for the title attribute. – Sumurai8 Commented Jul 1, 2013 at 17:50
  • yes I know, the logo is displayed to big, but I cant find the reason – derekwiking Commented Jul 1, 2013 at 18:35
Add a ment  | 

3 Answers 3

Reset to default 2

You can attach the onmouseover and onmouseout attributes to your hyperlinks.

<a href="javascript:unhide('Juli');" onmouseover="unhide('Juli');" onmouseout="unhide('Juli');"><span style="color:#000000;">Juli</span></a>

I notice you're using the same function to hide and unhide. You may want to create two separate functions, because with the code I've supplied, hovering the mouse over the link will unhide it, but clicking the link will then hide it again.

You could probably do that without JavaScript with just CSS:

.item-page h3:hover + div .hidden { 
    display:block;
    visibility:visible;
}

There is also the title attribute:

<span title="this is the tooltip text">hove me</span>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745048727a4608254.html

相关推荐

  • javascript - Display text on mouseover - Stack Overflow

    Hy there, this is what I have reached since now:<script type="textjavascript">function

    7小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信