Scroll to anchor with jQuery

Today I needed to create link with anchor. When I pushed it, it opens new page and add class to div. The source code is:

var class= window.location.href.slice(window.location.href.indexOf('#') + 1).split('#');
if(class){
jQuery('.testimonial_cont').find('.'+class).show('slow');
jQuery('html,body').animate({scrollTop: jQuery('.testimonial_cont').find('.'+class).parent().offset().top},'slow');
}

Of course you can change slow to normal or fast or even a int in milliseconds.

I hope it will help for someone.

Add custom css class to wordpress wysiwyg editor

To add class to wordpress wysiwyg editor copy this php code to your theme function.php file

if ( ! function_exists('tdav_css') ) {
	function tdav_css($wp) {
		$wp .= ',' .get_bloginfo('stylesheet_directory') . '/style_css.css';
	return $wp;
	}
}
add_filter( 'mce_css', 'tdav_css' );

Here you add new style file. In this file create your new css classes. Now go to wysiwyg editor and there you will see your created classes. Use them for table or links.