The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Help With A JavaScript

View previous topic View next topic Go down

In progress Help With A JavaScript

Post by FrOsTyXi on January 4th 2015, 3:54 am

Hello @Ange or anyone who may be able to assist, I have a hover over profile system on the index or all pages. Was wondering is someone could look at this code and see if any errors are in it due to CUP spiking around 85% and 95%

Code:
jQuery(document).ready(function() {
        $('.tcr a[href*="/u"]').mouseover(function() {
            $(this).parents('strong').css('position', 'relative');
            $('.cp_geral').remove();
            $(this).parents('.tcr').css('overflow', 'visible');
            $(this).before('<a href="' + $(this).attr('href') + '"><div class="cp_geral" style="position:absolute;"><div class="cp_box"> <div class="cp_capa"> <div class="cp_capa-avatar"><img src="http://i.imgur.com/1rHWZUQ.gif" /></div> <div class="cp_capa-nick"> <strong>' + $(this).html() + '</strong> <span class="span_capa-nick"></span> </div> </div> <div class="cp_info"> <div class="cp_info-botoes"> <div class="cp_info-botoes-post"><strong></strong><span>posts</span></div> <div class="cp_info-botoes-rep"><strong></strong><span>reputation</span></div> <div class="cp_info-botoes-data"><strong></strong><span>join date</span></div> </div> </div> <div class="cp_icones"> <div class="cp_mp"><a href="/privmsg?mode=post&u=' + $(this).attr('href').replace('/u', '') + '">PM</a></div> <div class="cp_perfil"><a href="' + $(this).attr('href') + '">PROFILE</a></div> </div></div> </div></a>');
            $.get($(this).attr('href'), function(cps) {
                $('.span_capa-nick').html($('#profile-advanced-right .main-content.clearfix.center:eq(0)', cps).html());
                $('.cp_capa-avatar').html($('#profile-advanced-right .main-content.clearfix.center:eq(0)', cps).html());
                $('.cp_info-botoes-data strong').html($('#field_id-4 dd div', cps).html());
                $('.cp_info-botoes-post strong').html($('#field_id-6 dd div', cps).html());
                $('.cp_info-botoes-rep strong').html($('#field_id-14 dd div', cps).html());
            });
            $('.cp_geral').mouseleave(function() {
                $(this).remove();
            });
        });
    });


Thank You in advance!

FrOsTyXi
Forumember

Male Posts : 460
Reputation : 12
Language : english

http://team-psn.forum-board.net/

Back to top Go down

In progress Re: Help With A JavaScript

Post by Ange Tuteur on January 12th 2015, 8:47 am

Hello @FrOsTyXi,

You're talking about your CPU, correct ? I tested it on my forum and didn't notice anything abnormal. My CPU was the same, around 10-30% usage.

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

In progress Re: Help With A JavaScript

Post by FrOsTyXi on January 12th 2015, 10:22 pm

Thank you sir trying to find out what is making the cpu go crazy thanks again

FrOsTyXi
Forumember

Male Posts : 460
Reputation : 12
Language : english

http://team-psn.forum-board.net/

Back to top Go down

View previous topic View next topic Back to top


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