Good art is a taste, good design is an opinion.


Come as guest, stay as family.
Board Index

Come as guest, stay as family.


You are not connected. Please login or register

Foto

[Javascript] Mouseover Profile info



View previous topic View next topic Go down Message [Page 1 of 1]

1
Offline

  Shadow

avatar
Administrator
Administrator


Tutorial: Mouseover Profile info

This feature will show user informations when you mouseover username on last topic.


--> Tutorials, tips and tricks <--
Mouseover Profile info


- Javascript
Code:
       jQuery(document).ready(function(){
            jQuery('.tcr a[href*="/u"]').mouseover(function(){
            jQuery(this).parents('strong').css('position', 'relative');
            jQuery('.perfilInfo').remove();
            jQuery(this).parents('.tcr').css('overflow', 'visible');
            jQuery(this).before('
            <div class="perfilInfo" style="position:absolute;">
            <span class="setPerfil">
            <span>
            <img class="PerfilInfoImg" src="http://forum.teamspeak.com.br/public/style_images/master/profile/default_large.png" />
            <h2>'+jQuery(this).html()+'</h2>
            <p><b>Rank:</b><span></span></p>
            <p><b>Posts:</b><span></span></p>
            <p><b>Joined:</b><span></span></p>
            <p><b>Points:</b><span></span></p>
            <span class="linkPrf"><a href="/privmsg?mode=post&u='+jQuery(this).attr('href').replace('/u', '')+'">Send PM</a></span>
            <span class="linkPrf"><a href="'+jQuery(this).attr('href')+'">View Profile</a></span>
            </span>
            </span>
            </span>
            </div>
            ');
            jQuery.get(jQuery(this).attr('href'), function(retornoMembro){
            var avtPrf = jQuery('#profile-advanced-right img:first', retornoMembro).attr('src');
            jQuery('.PerfilInfoImg').attr('src', avtPrf);
            var perfil_rank = jQuery('#profile-advanced-right .module .main-content img:eq(1)', retornoMembro).attr('alt');
            var perfil_post = jQuery('#field_id-6 dd', retornoMembro).html();
            var perfil_cad = jQuery('#field_id-4 dd', retornoMembro).html();
            var perfil_lastV = jQuery('#field_id-13 dd', retornoMembro).html();
            jQuery('.setPerfil p:eq(0) span').html(perfil_rank);
            jQuery('.setPerfil p:eq(1) span').html(perfil_post);
            jQuery('.setPerfil p:eq(2) span').html(perfil_cad);
            jQuery('.setPerfil p:eq(3) span').html(perfil_lastV);
            });
            //get
            jQuery('.perfilInfo').mouseleave(function(){
            jQuery(this).remove();
            });//mouseleave
            });
            //mouseover
            });
- Applying javascript
Go to Control Panel Modules HTML and Javascript code Javascript Management
Click the "Create a new javascript"

Title - You have to put a title for the page, so you can identify it in the list of pages JavaScript Control Panel;
Placement - Choose "In all pages";
JavaScript code - In this field we have to insert the code that worked in the previous item;
Confirm - Finally, after adding the code you need to click this button to save the setting. If you click another button or another section, the changes will not be validated.
- Preview
http://i.imgur.com/IswWZ3I.png


- CSS
Add following code to the CSS

Code:
[panda=css].perfilInfo {
    background: url(http://i77.servimg.com/u/f77/16/58/45/96/bottom10.png) no-repeat 98% 0;
    float: left;
    height: 177px;
    left: -40em;
    padding: 16px 0 38px 5px;
    top: 13px;
    width: 510px;
    z-index: 999;
    }
    .setPerfil > span {
    background: #f9f9f9;
    border: 1px solid #999;
    border-radius: 3px;
    display: block;
    height: 100%;
    padding: 3px;
    }
    .sprite-icon_topic_latest {
    background: url(http://illiweb.com/fa/sprite_icons.png) no-repeat top left;
    background-position: -1083px 0;
    height: 9px;
    width: 11px;
    }
    .setPerfil {
    background: rgba(0,0,0,0.3);
    border-radius: 3px;
    display: block;
    height: 100%;
    padding: 5px 5px 10px;
    }
    .setPerfil .PerfilInfoImg {
    -moz-box-shadow: 0 2px 2px rgba(0,0,0,0.1);
    -webkit-box-shadow: 0 2px 2px rgba(0,0,0,0.1);
    background: #fff;
    border: 1px solid #D5D5D5;
    box-shadow: 0 2px 2px rgba(0,0,0,0.1);
    display: table;
    float: left;
    height: 91px;
    padding: 1px;
    width: 91px;
    }
    .setPerfil h2 {
    background: #E1E1E1;
    border-radius: 0 10px 0 0;
    box-shadow: 1px 1px 0 #CCC;
    display: block;
    float: left;
    font-family: "Trebuchet MS";
    font-size: 19px;
    font-style: normal;
    font-variant: normal;
    font-weight: bold;
    margin-bottom: 10px;
    padding: 5px;
    text-shadow: 1px 1px 0 #fff;
    width: 382px;
    }
    .setPerfil p {
    -moz-transition: all .2s ease-in-out;
    -o-transition: all .2s ease-in-out;
    -webkit-transition: all .2s ease-in-out;
    background: #F1F1F1;
    border-left: 3px solid #333;
    border-top: 1px solid #333;
    box-shadow: 1px 1px 0 #CCC;
    display: block;
    float: right;
    font-weight: 400;
    margin: 2px 5px;
    padding: 5px;
    text-align: left;
    width: 350px;
    }
    .setPerfil p {
    font-weight: 400;
    text-align: left;
    }
    .linkPrf {
    -moz-transition: all .2s ease-in-out;
    -o-transition: all .2s ease-in-out;
    -webkit-transition: all .2s ease-in-out;
    background: #F6F6F6;
    border: 1px solid #DBDBDB;
    border-radius: 0 0 4px 4px;
    border-top: none;
    bottom: -7px;
    box-shadow: 0 1px 0 rgba(255,255,255,1) inset, 0 1px 0 rgba(0,0,0,0.3);
    color: #616161;
    float: left;
    height: 14px;
    left: 13.8em;
    margin: 2px;
    padding: 2px;
    text-align: center;
    text-decoration: none!important;
    transition: all .2s ease-in-out;
    width: 8em;
    }
    .linkPrf a {
    color: #616161!important;
    font-size: 12px;
    font-style: normal;
    font-variant: normal;
    font-weight: normal;
    text-decoration: none;
    }
    .setPerfil p:hover {
    box-shadow: 1px 1px 0 #9A9A9A;
    }.setPerfil p div {
    display: inline;
    }
- Preview
http://www.dodaj.rs/f/A/qC/1La28gz6/untitled.png



  • Important thing to know?
    This will not work with IPB Profile tutorial. You must have advanced profile activated.






© PunBB Design


If you have any questions related to this topic create a topic with the following title:
Mouseover Profile info

Powered by PunBB
Currently 0 users have thanked Shadow for this post:

2
Offline

  Shadow

avatar
Administrator
Administrator
Topic has been updated!

Powered by PunBB
Currently 0 users have thanked Shadow for this post:

3
Offline

  tommycoo

avatar
Punbb Senior
Punbb Senior
is this possible to make it from html ? i mean i want to edit the style ?

Powered by PunBB
Currently 0 users have thanked tommycoo for this post:

4
Offline

  Guest

avatar
Guest
Very much like this feature thanks for sharing shadow

Powered by PunBB
Currently 0 users have thanked Guest for this post:

5
Offline

  Ethen

avatar
Punbb Rookie
Punbb Rookie
Very nice style thanks

Powered by PunBB
Currently 0 users have thanked Ethen for this post:

6
Offline

  J0k3R^

avatar
Pemanently Banned
Pemanently Banned
good one.

Powered by PunBB
Currently 0 users have thanked J0k3R^ for this post:

7
Offline

  Michael_vx

avatar
Punbb Junior
Punbb Junior
hi
test on Arabic phpbb2 forum didnt work
is there any way to solve ?
Very Happy

Powered by PunBB
Currently 0 users have thanked Michael_vx for this post:

8
Offline

  MoiLulu

avatar
Punbb Rookie
Punbb Rookie
Thanks Smile
Worked a charm!

Powered by PunBB
Currently 0 users have thanked MoiLulu for this post:

9
Offline

  deaneo8

avatar
V.I.P. Member
V.I.P. Member
when try add this code to my css
my css wont save my css go blank to white screen

Code:
.perfilInfo {
    background: url(http://i77.servimg.com/u/f77/16/58/45/96/bottom10.png) no-repeat 98% 0;
    float: left;
    height: 177px;
    left: -40em;
    padding: 16px 0 38px 5px;
    top: 13px;
    width: 510px;
    z-index: 999;
    }
    .setPerfil > span {
    background: #f9f9f9;
    border: 1px solid #999;
    border-radius: 3px;
    display: block;
    height: 100%;
    padding: 3px;
    }
    .sprite-icon_topic_latest {
    background: url(http://illiweb.com/fa/sprite_icons.png) no-repeat top left;
    background-position: -1083px 0;
    height: 9px;
    width: 11px;
    }
    .setPerfil {
    background: rgba(0,0,0,0.3);
    border-radius: 3px;
    display: block;
    height: 100%;
    padding: 5px 5px 10px;
    }
    .setPerfil .PerfilInfoImg {
    -moz-box-shadow: 0 2px 2px rgba(0,0,0,0.1);
    -webkit-box-shadow: 0 2px 2px rgba(0,0,0,0.1);
    background: #fff;
    border: 1px solid #D5D5D5;
    box-shadow: 0 2px 2px rgba(0,0,0,0.1);
    display: table;
    float: left;
    height: 91px;
    padding: 1px;
    width: 91px;
    }
    .setPerfil h2 {
    background: #E1E1E1;
    border-radius: 0 10px 0 0;
    box-shadow: 1px 1px 0 #CCC;
    display: block;
    float: left;
    font-family: "Trebuchet MS";
    font-size: 19px;
    font-style: normal;
    font-variant: normal;
    font-weight: bold;
    margin-bottom: 10px;
    padding: 5px;
    text-shadow: 1px 1px 0 #fff;
    width: 382px;
    }
    .setPerfil p {
    -moz-transition: all .2s ease-in-out;
    -o-transition: all .2s ease-in-out;
    -webkit-transition: all .2s ease-in-out;
    background: #F1F1F1;
    border-left: 3px solid #333;
    border-top: 1px solid #333;
    box-shadow: 1px 1px 0 #CCC;
    display: block;
    float: right;
    font-weight: 400;
    margin: 2px 5px;
    padding: 5px;
    text-align: left;
    width: 350px;
    }
    .setPerfil p {
    font-weight: 400;
    text-align: left;
    }
    .linkPrf {
    -moz-transition: all .2s ease-in-out;
    -o-transition: all .2s ease-in-out;
    -webkit-transition: all .2s ease-in-out;
    background: #F6F6F6;
    border: 1px solid #DBDBDB;
    border-radius: 0 0 4px 4px;
    border-top: none;
    bottom: -7px;
    box-shadow: 0 1px 0 rgba(255,255,255,1) inset, 0 1px 0 rgba(0,0,0,0.3);
    color: #616161;
    float: left;
    height: 14px;
    left: 13.8em;
    margin: 2px;
    padding: 2px;
    text-align: center;
    text-decoration: none!important;
    transition: all .2s ease-in-out;
    width: 8em;
    }
    .linkPrf a {
    color: #616161!important;
    font-size: 12px;
    font-style: normal;
    font-variant: normal;
    font-weight: normal;
    text-decoration: none;
    }
    .setPerfil p:hover {
    box-shadow: 1px 1px 0 #9A9A9A;
    }.setPerfil p div {
    display: inline;
    }

Powered by PunBB
Currently 0 users have thanked deaneo8 for this post:

10
Offline

  Virus

avatar
★Moderator★
★Moderator★
[infos="Questions and Problems"]Hello,

You have to create a new topic to Questions & Problems referring to this post. That way other members with the same question will find the answers easier in the correct category.[/infos]

Tip: If you get the white screen, refresh and check if the CSS what added.

Powered by PunBB
Currently 0 users have thanked Virus for this post:

11
Offline

  deaneo8

avatar
V.I.P. Member
V.I.P. Member
Sherlock H. wrote:[link="/t7-javascript-mouseover-profile-info#4332"][infos="Questions and Problems"]Hello,

You have to create a new topic to Questions & Problems referring to this post. That way other members with the same question will find the answers easier in the correct category.[/infos]

Tip: If you get the white screen, refresh and check if the CSS what added.

bro could help me add this bro

Powered by PunBB
Currently 0 users have thanked deaneo8 for this post:

12
Offline

  Virus

avatar
★Moderator★
★Moderator★
Refresh your forum and try not to add anything else in your CSS because it is full! Smile

Powered by PunBB
Currently 0 users have thanked Virus for this post:

13
Offline

  Sponsored content



Powered by PunBB
Currently 0 users have thanked Sponsored content for this post:

View previous topic View next topic Back to top Message [Page 1 of 1]


Topic URL's

URL
BBcode
HTML

Permissions in this forum:
You cannot reply to topics in this forum