رفتن به مطلب

ثابت ماندن بر روی انتخاب


Elham

پست های پیشنهاد شده

با سلام و احترام


<?php
/**
*/
?><!DOCTYPE html>
<!--[if IE 6]>
<html id="ie6" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 7]>
<html id="ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html id="ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 6) | !(IE 7) | !(IE 8) ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php
/*
* Print the <title> tag based on what is being viewed.
*/
global $page, $paged;
wp_title( '|', true, 'right' );
// Add the blog name.
bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );
?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->
<?php
add_action("gform_enqueue_scripts", "enqueue_city_script", 10, 2);
function enqueue_city_script($form, $is_ajax){
if(!$is_ajax){
wp_enqueue_script('city_script', get_template_directory_uri() . '/js/city.js');
}
}
?>
<?php
/* We add some Javascript to pages with the comment form
* to support sites with threaded comments (when in use).
*/
if ( is_singular() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
/* Always have wp_head() just before the closing </head>
* tag of your theme, or you will break many plugins, which
* generally use this hook to add elements to <head> such
* as styles, scripts, and meta tags.
*/
wp_head();
?>
</head>
<body
<?php body_class(); ?>>
<div id="page" class="hfeed">
<header id="branding" role="banner">
<map name="FPMap2">
<area href="/En" shape="rect" coords="198, 54, 257, 76">
<area href="/ru" shape="rect" coords="135, 50, 193, 76">
<area coords="833, 8, 990, 73" shape="rect" href="/Fa">
</map>
<img border="0" src="http://www.golnoor.com/up/Title Farsi.gif" width="1000" height="80" usemap="#FPMap2">
<div id="navigation_ribbon" class="clearfix level_2 carousel images single_arrow">
<div class="subnav_container jcarousel-container jcarousel-container-horizontal" style="display: block;">
<div class="jcarousel-clip jcarousel-clip-horizontal">
<ul class="navigation_list jcarousel-list jcarousel-list-horizontal" style="width: 1000px; left: 0px; right: 0px;">
<li class="first jcarousel-item jcarousel-item-horizontal jcarousel-item-1 jcarousel-item-1-horizontal" jcarouselindex="1">
<span class="highlight"></span>
<a href="/component">
<img src="http://golnoor.com/Department/ICON/Comp.png" alt="Companent" class="default">
<img src="http://golnoor.com/Department/haver/Comp.png" alt="Companent" class="hover">
<span> </span>

</a></li><li class="jcarousel-item jcarousel-item-horizontal jcarousel-item-2 jcarousel-item-2-horizontal" jcarouselindex="2">
<span class="highlight"></span>
<a href="/indoor">
<img src="http://golnoor.com/Department/ICON/INDOOR.png" alt="City Centers" class="default">
<img src="http://golnoor.com/Department/haver/INDOOR.png"City Centers" class="hover">
<span></span>

</a></li><li class="jcarousel-item jcarousel-item-horizontal jcarousel-item-3 jcarousel-item-3-horizontal" jcarouselindex="3">
<span class="highlight">
</span><a href="/solar">
<img src="http://golnoor.com/Department/ICON/Solar.png" alt="Residential areas" class="default">
<img src="http://golnoor.com/Department/haver/Solar.png" alt="Residential areas" class="hover">
<span></span>

</a></li><li class="jcarousel-item jcarousel-item-horizontal jcarousel-item-4 jcarousel-item-4-horizontal" jcarouselindex="4">
<span class="highlight"></span>
<a href="/petronoor">
<img src="http://golnoor.com/Department/ICON/PetroNoor.png" alt="Petronoor" class="default">
<img src="http://golnoor.com/Department/haver/PetroNoor.png" alt="Petronoor" class="hover">
<span></span>

</a></li><li class="jcarousel-item jcarousel-item-horizontal jcarousel-item-5 jcarousel-item-5-horizontal" jcarouselindex="5"><span class="highlight">
</span><a href="/sazeh">
<img src="http://golnoor.com/Department/ICON/Sazeh.png" alt="Major roads" class="default">
<img src="http://golnoor.com/Department/haver/Sazeh.png" alt="Major roads" class="hover">
<span></span>

</a></li><li class="last jcarousel-item jcarousel-item-horizontal jcarousel-item-6 jcarousel-item-6-horizontal" jcarouselindex="6">
<span class="highlight"></span>
<a href="/lighting">
<img src="http://golnoor.com/Department/ICON/Lighting.png" alt="LIGHTING" class="default">
<img src="http://golnoor.com/Department/haver/Lighting.png" alt="LIGHTING" class="hover">
<span></span>
</a></li><li class="last jcarousel-item jcarousel-item-horizontal jcarousel-item-7 jcarousel-item-7-horizontal" jcarouselindex="7">
<span class="highlight"></span>
<a href="/outdoor">
<img src="http://golnoor.com/Department/ICON/Outdoor.png" alt="Transportation areas" class="default">
<img src="http://golnoor.com/Department/haver/Outdoor.png" alt="Transportation areas" class="hover">
<span></span>

</a></li></ul></div></div></div>
<style>

div#navigation_ribbon{font-family:Verdana, Arial, Helvetica, sans-serif;font-size:70%;color:#252F47;line-height:16px;margin:0 auto;text-align:left !important;background-color:#fff;line-height:1}
div#navigation_ribbon div,div#navigation_ribbon span,div#navigation_ribbon h1,div#navigation_ribbon h2,div#navigation_ribbon h3,div#navigation_ribbon h4,div#navigation_ribbon h5,div#navigation_ribbon h6,div#navigation_ribbon p,div#navigation_ribbon blockquote,div#navigation_ribbon a,div#navigation_ribbon em,div#navigation_ribbon img,div#navigation_ribbon strong,div#navigation_ribbon dl,div#navigation_ribbon dt,div#navigation_ribbon dd,div#navigation_ribbon ol,div#navigation_ribbon ul,div#navigation_ribbon li,div#navigation_ribbon fieldset,div#navigation_ribbon form,div#navigation_ribbon label,div#navigation_ribbon legend,div#navigation_ribbon table,div#navigation_ribbon tbody,div#navigation_ribbon tfoot,div#navigation_ribbon thead,div#navigation_ribbon tr,div#navigation_ribbon th,div#navigation_ribbon td{border:0;outline:0;font-size:12px;line-height:14px;vertical-align:baseline;background:transparent;margin:0;padding:0}
div#navigation_ribbon strong,div#navigation_ribbon th,div#navigation_ribbon h1,div#navigation_ribbon h2,div#navigation_ribbon h3,div#navigation_ribbon h4,div#navigation_ribbon h5,div#navigation_ribbon h6{font-weight:bold}
div#navigation_ribbon ol,div#navigation_ribbon ul{list-style:none;list-style-image:none}
div#navigation_ribbon table{border-collapse:collapse;border-spacing:0}
div#navigation_ribbon button{background-color:transparent;border:none;outline:none;overflow:visible;padding:0;width:auto;}
div#navigation_ribbon {
clear:both;
margin:0 auto;
position:relative;
width:1000px;
}
div#navigation_ribbon div.subnav_container{
background:#E1E1E9 url(../../images/lighting/molecular/navigation_bg_body.png) repeat-x left top;

border-width:0 1px;
clear:both;
height:96px;
margin:0px auto 0px 0px;
padding-top:1px;
position:relative;
width:1000px;
}
div#navigation_ribbon.images.ie7 div.subnav_container{
padding-top:0;
}
div#navigation_ribbon div.reset_height{
background:#E1E1E9 url(../../images/lighting/molecular/navigation_bg_body_resize.png) repeat-x left top;
}
div#navigation_ribbon.no_images div.subnav_container{
height:68px;
}
div#navigation_ribbon div.navigation_bottom {
background:url(../../images/lighting/molecular/sprites_nav_ribbon.png) no-repeat 0 -302px;
height:13px;
margin:0 auto;
position:relative;
width:958px;
z-index:100;
}
div#navigation_ribbon div.navigation_bottom_space {
height:10px;
margin:0 auto;
position:relative;
width:958px;
z-index:100;
}

div#navigation_ribbon ul.navigation_list li{

border-left:1px solid #B7BAC3;
float: left;
height:85px;
margin-top:5px;
position:relative;
width:140px;
}


div#navigation_ribbon ul.navigation_list li a{
color:#5D6678;
display:block;
height:100%;
text-decoration:none;
width:100%;
}
div#navigation_ribbon ul.navigation_list li a span{
cursor:pointer;
cursor:hand;
font-size:10px;
line-height:115%;
padding:0 15px;
position:absolute;
text-align:center;
top:53px;
width:75px;
}
div#navigation_ribbon ul.navigation_list li a span.inner{
padding:0;
position:relative;
top:auto;
width:auto;
}
div#navigation_ribbon ul.navigation_list li a.no_image span.outer{
display:table;
height:100%;
position:relative;
top:auto;
}
div#navigation_ribbon.ie7 ul.navigation_list li a.no_image span.outer{
height:auto;
position:absolute;
top:50%;
}
div#navigation_ribbon ul.navigation_list li a.no_image span.inner{
display:table-cell;
padding:0;
position:relative;
top:auto;
vertical-align:middle;
}
div#navigation_ribbon.ie7 ul.navigation_list li a.no_image span.inner{
display:block;
position:relative;
top:-50%;
}
div#navigation_ribbon.no_images ul.navigation_list li a span.outer{
text-align:center;
z-index:2;
}
div#navigation_ribbon ul.navigation_list li a span span.truncated{
padding:0;
position:static;
top:auto;
width:auto;
}
div#navigation_ribbon ul.navigation_list li img{
display:block;
height:110px;
margin:0 auto;
position:relative;
width:110px;
z-index:2;
}
div#navigation_ribbon ul.navigation_list li img.hover{
display:none;
}
div#navigation_ribbon ul.navigation_list li:hover img.default{
display:none;
}
div#navigation_ribbon ul.navigation_list li:hover img.hover,
div#navigation_ribbon ul.navigation_list li.active img.default{
display:block;
}
</style>
<?php if ( function_exists( 'show_simpleresponsiveslider' ) ) show_simpleresponsiveslider(); ?>
<?php if(function_exists('show_media_header')){ show_media_header(); } ?>
<?php if(function_exists('wp_content_slider')) { wp_content_slider(); } ?>
<hgroup><h1 id="site-title"><span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></h1>
<h2 id="site-description"><?php bloginfo( 'description' ); ?>
</h2>
</hgroup>
<?php
// Check to see if the header image has been removed
$header_image = get_header_image();
if ( $header_image ) :
// Compatibility with versions of WordPress prior to 3.4.
if ( function_exists( 'get_custom_header' ) ) {
// We need to figure out what the minimum width should be for our featured image.
// This result would be the suggested width if the theme were to implement flexible widths.
$header_image_width = get_theme_support( 'custom-header', 'width' );
} else {
$header_image_width = HEADER_IMAGE_WIDTH;
}
?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
<?php
// The header image
// Check if this is a post or page, if it has a thumbnail, and if it's a big one
if ( is_singular() && has_post_thumbnail( $post->ID ) &&
( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) &&
$image[1] >= $header_image_width ) :
//Houston, we have a new header image!
echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
else :
//
if ( function_exists( 'get_custom_header' ) ) {
$header_image_width = get_custom_header()->width;
$header_image_height = get_custom_header()->height;
} else {
$header_image_width = HEADER_IMAGE_WIDTH;
$header_image_height = HEADER_IMAGE_HEIGHT;
}
?>
<img src="
<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" />
<?php endif; // end check for featured image or standard header ?>
</a>
<?php endif; // end check for removed header image ?>
<?php
// Has the text been hidden?
if ( 'blank' == get_header_textcolor() ) :
?>
<div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>">
<?php get_search_form(); ?>
</div>
<?php
else :
?>
<?php get_search_form(); ?>

<?php endif; ?>
<nav id="access" role="navigation">
<h3 class="assistive-text"><?php _e( 'Main menu', 'twentyeleven' ); ?></h3>
<?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?>
<div class="skip-link"><a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to primary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to primary content', 'twentyeleven' ); ?></a></div>
<div class="skip-link"><a class="assistive-text" href="#secondary" title="<?php esc_attr_e( 'Skip to secondary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to secondary content', 'twentyeleven' ); ?></a></div>
<?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assigned to the primary location is the one used. If one isn't assigned, the menu with the lowest ID is used. */ ?>
<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
</nav><!-- #access -->
</header><!-- #branding -->
<div id="main">
<head>
<link rel="shortcut icon" href="favicon.ico">
<link rel="icon" type="image/gif" href="animated_favicon1.gif">
</head>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-55037519-1', 'auto');
ga('send', 'pageview');
</script>

اینها کد هدر سایت من هستند به آدرس زیر:

سایت

همون طور که میبینید روی هر منوی اصلی می ایستیم رنگی میشه. میخوام داخل هر دپارتمان هم که میرم رنگی بمونه که معلوم بشه الان کجا هستیم.

به کدم باید hover اضافه کنم؟؟

لینک به ارسال

سلام ، برای منو های وردپرس میشه از یه تابع ساده استفاده کرد مثل سایت زیر:

https://wordpress.org/support/topic/adding-active-class-to-active-menu-item

ولی خب چون شما منوتون رو غیراستاندارد (یعنی به غیر از توابع وردپرس) ساختید باید از یه راه دیگه برید ، به این طریق که یا از طریق php یا از طریق Javascript آدرس فعلی صفحه رو بگیرید و تعریف کنید که اگر فلان صفحه بود ، فلان عکس رو displayش رو none کنه و فلان عکس رو displayش رو block کنه.

  • امتیاز 2
لینک به ارسال

میشه یکم لطفا مبتدی تر برام توضیح بدید. بتونم پیاده سازیش کنم.

من خیلی مبتدی هستم...

لینک به ارسال
  • 2 هفته بعد...
×
×
  • اضافه کردن...