ok so I have two codes, issues with both. They go hand in hand, so please don't say make two separate post. I need the scrollTop to work after the second code is finished. Thank You
This part is DONE~!
$('html,body').animate({
scrollTop: '+=' + $('a[name="quickreply"]').offset().top + 'px'
}, '3000');
Changed it to
$('html,body').animate({
scrollTop: $('a[name="quickreply"]').offset().top;
}, '3000');
Next I found this code here on stackoverflow from tim down I believe?
Updated fiddle: http://jsfiddle.net/dKaJ3/340/
I need that to only be able to select in a certain div I choose, and only text not the HTML since my site only accepts BBcodes.
Here is the full code I was using but grabbing the entire post, instead I want only what the user selects.
$('.post').each(function() {
var text = $('#text_editor_textarea');
var uid = $(this).find('.username a').text();
var usermess = $(this).find('.entry-content div div').text();
$(this).find('.quote').click(function() {
text.val(text.val()+'[quote="'+ uid +'"]'+ usermess +'[/quote]');
$('html,body').animate({
scrollTop: '+=' + $('a[name="quickreply"]').offset().top + 'px'
}, '3000');
});
});
Any assistance would be nice, as I've been working on the .getSelection for a few hours now and this is my first time using it. Thank you.