The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Help With A JavaScript

2 posters

Go down

In progress Help With A JavaScript

Post by FrOsTyXi 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
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 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
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: Help With A JavaScript

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

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

Male Posts : 460
Reputation : 12
Language : english

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

Back to top Go down

Back to top

- Similar topics

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