Help With A JavaScript
2 posters
Page 1 of 1
Help With A JavaScript
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%
Thank You in advance!
- 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!
Re: Help With A JavaScript
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.
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.
Re: Help With A JavaScript
Thank you sir trying to find out what is making the cpu go crazy thanks again
Similar topics
» Javascript- More then 1 javascript code
» Javascript Help
» javascript
» javascript help plz
» Javascript
» Javascript Help
» javascript
» javascript help plz
» Javascript
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum