I'm using the Kendo-UI Tabstrip, and would like to add a class to one specific tabpanel. Is this possible? Using .SpriteCssClasses within the items.Add() section only seems to add the class to the tab itself, and not the actual panel.
Any help is greatly appreciated.
You can try to get the specific panel using the ID because kendo will add a div with specific ID depending on the name of the tab strip and the tab number (order), for example:
#(Html.Kendo().TabStrip()
.Name("Main")
.Items(Main =>
{
Main.Add()
.Text("test1 title").Content(#<text>
test1
</text>);
Main.Add()
.Text("test2 title")
.Content(#<text>
test2
</text>);
})
)
This will generate the following HTML:
<div class="k-tabstrip-wrapper" style="">
<div id="Main" class="k-widget k-tabstrip k-header" data-role="tabstrip" tabindex="0" role="tablist" aria-activedescendant="Main_ts_active">
<ul class="k-reset k-tabstrip-items">
<li class="k-item k-state-default k-first k-tab-on-top k-state-active" role="tab" aria-controls="Main-1" style="" aria-selected="true">
<span class="k-loading k-complete"></span>
test1 title
</li>
<li class="k-item k-state-default k-last" role="tab" aria-controls="Main-2" style="">
<span class="k-loading k-complete"></span>
test2 title
</li>
</ul>
<div id="Main-1" class="k-content k-state-active" role="tabpanel" aria-expanded="true" style="height: auto; overflow: hidden; opacity: 1; display: block;">
<div style="display: none; position: absolute; opacity: 0.8; background-color: rgb(255, 255, 255); z-index: 1001; width: 33.4px; height: 20px;" class="tata-ajax-loader">
<div style="background-position: center;background-repeat: no-repeat;height:100%;width:100%;background-color: transparent;" class="tata-ajax-loader-img"></div>
</div>
test1
</div>
<div id="Main-2" class="k-content" role="tabpanel" aria-expanded="false" style="height: auto; overflow: hidden; opacity: 0; display: none;" aria-hidden="true">
<div style="display: none; position: absolute; opacity: 0.8; background-color: rgb(255, 255, 255); z-index: 1001; width: 33.4px; height: 20px;" class="tata-ajax-loader">
<div style="background-position: center;background-repeat: no-repeat;height:100%;width:100%;background-color: transparent;" class="tata-ajax-loader-img"></div>
</div>
test2
</div>
</div>
</div>
Note the divs with IDs "Main-1" and "Main-2" are the IDs of the actual panels which is what you want from what I understand so you can add CSS on the IDs:
#Main-1 {
background-color: #E3F7A8;
}
Related
<link href="https://www1.chester.ac.uk/sites/all/themes/global/css/app_chester.css" rel="stylesheet"/>
<div style="background: #eaeaea">
<div class="column row">
<div class="m-modal-video__column m-modal-video__column--primary">
<div class="m-modal-video m-modal-video--primary-full-width">
<div class="m-cta__vcenter"><h3 style="color: black; text-align: center;">Be Part of It</h3>
<p style="color: black; text-align: center;">Choose an innovative degree that has been designed with your employability at its core.</p>
</div>
</div>
</div>
<div class="m-modal-video__column m-modal-video__column--secondary">
<div class="m-modal-video m-modal-video--primary-full-width">
<div class="m-cta__vcenter">
<div class="m-modal-video__container m-modal-video__container--cinemascope" data-open="youtubemodal">
<a><img src="http://img.youtube.com/vi/Ily454tCpWE/maxresdefault.jpg">
<div class="m-modal-video__overlay m-modal-video__overlay--triangle">
<div class="m-modal-video m-modal-video__triangle"></div>
</div></a>
</div>
<div class="reveal large" id="youtubemodal" data-reveal data-reset-on-close="true">
<div class="m-video m-video--modal m-video--cinemascope"><iframe src="https://www.youtube.com/embed/Ily454tCpWE" frameborder="0" allowfullscreen=""></iframe></div>
<button class="close-button" data-close aria-label="Close modal" type="button">
<span aria-hidden="true">×</span>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
I've got a modal on my site, and use the following to display a thumbnail image:
http://img.youtube.com/vi/DxwrdB7A6-I/maxresdefault.jpg
The problem is the video has an aspect ratio of 21:9. I've used the following styles, but still get the black letterbox on both the top and bottom of the image. Is there a way to just display the YouTube thumbnail without the black letterbox?
&__container {
position: relative;
height: 0;
padding-bottom: 42.85714%;
overflow: hidden;
margin-bottom: 1rem;
a img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
I've modified your sample code to add two new CSS rules to correspond to a class your HTML already had with no styles:
.m-modal-video__container--cinemascope defines the container around your cinemascope-ratio image, using the padding-bottom trick you'd previously tried implementing.
.m-modal-video__container--cinemascope img defines the sizing and positioning of the image inside the above container. Knowing you want this image to maintain its aspect ratio and not stretch, I've removed the height: 100% rule (so the height is automatically calculated) and vertically centered the image with the top: 50% and transform: translateY(-50%) trick.
This is all needed because YouTube still produced a 16:9 JPG thumbnail for your video despite its 21:9 ratio, so we're essentially using this trick to hide the black bars in the image. I still see a tiny sliver poking through, but you slightly adjust your padding-bottom ratio if you were worried about that, or increase your img's width past 100%.
.m-modal-video__container--cinemascope {
position: relative;
height: 0;
padding-bottom: 42.85714%;
overflow: hidden;
}
.m-modal-video__container--cinemascope img {
position: absolute;
left: 0;
width: 100%;
top: 50%;
transform: translateY(-50%);
}
<link href="https://www1.chester.ac.uk/sites/all/themes/global/css/app_chester.css" rel="stylesheet" />
<div style="background: #eaeaea">
<div class="column row">
<div class="m-modal-video__column m-modal-video__column--secondary">
<div class="m-modal-video m-modal-video--primary-full-width">
<div class="m-cta__vcenter">
<div class="m-modal-video__container m-modal-video__container--cinemascope" data-open="youtubemodal">
<a><img src="http://img.youtube.com/vi/Ily454tCpWE/maxresdefault.jpg">
<div class="m-modal-video__overlay m-modal-video__overlay--triangle">
<div class="m-modal-video m-modal-video__triangle"></div>
</div>
</a>
</div>
<div class="reveal large" id="youtubemodal" data-reveal data-reset-on-close="true">
<div class="m-video m-video--modal m-video--cinemascope"><iframe src="https://www.youtube.com/embed/Ily454tCpWE" frameborder="0" allowfullscreen=""></iframe></div>
<button class="close-button" data-close aria-label="Close modal" type="button">
<span aria-hidden="true">×</span>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
Here's the problem:
For Chrome, Opera, Safari everthing is fine:
chrome, opera, edge thumb-bar
But firefox has a problem:
firefox thumbbar
The problem is caused by the x-scrollbar which pushes each ".thumbs" and
their children up. The children keep their aspect/ratio thanks to the
combination of height: 100% and object-fit contain, not leaving any gap between them, EXCEPT under firefox. It seems that ".thumbs" doesn't want to wrap correctly around its child image. The height gets adapted, but not the width. I've tried already different combinations of flex: - shorthands, but nothing helped.
.scroll_wrapper {
position: relative;
overflow: hidden;
height: 100px;
}
.thumbs_container {
position: absolute;
display: -webkit-box;
display: -moz-box;
display: -ms-flex;
display: -webkit-flex;
display: flex;
flex-flow: row nowrap;
overflow-x: scroll;
height: 100%;
width: 100%;
}
.thumbs {
display: -webkit-box;
display: -moz-box;
display: -ms-flex;
display: -webkit-flex;
display: flex;
flex-flow: column nowrap;
height: 100%;
}
.thumbs_imgs {
height: 100%;
object-fit: contain;
}
<div class="scroll_wrapper">
<div class="thumbs_container">
<div class="thumbs">
<img src="http://placeimg.com/170/110/any" alt="1" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/115/any" alt="2" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/120/any" alt="3" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/125/any" alt="4" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/130/any" alt="5" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/135/any" alt="6" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/135/any" alt="7" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/140/any" alt="8" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/145/any" alt="9" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/150/any" alt="10" class="thumbs_imgs"/>
</div>
</div>
</div>
I found a solution with a js-workaround:
firefox bug:
js loops through the width of each img and gives each parent ".thumbs" the corresponding width.
x-scrollbar-hide:
-js gets the height of the outer .scroll-wrapper
-js gets the difference of .thumbs_container - .thumbs to get the width of the scrollbar (exactly for each browser, because different)
-js gives the heights of .scroll-wrapper + scrollbar-height to .thumbs_container
window.onload = function() {
scrollbarHide()
}
function scrollbarHide(){
var modalThumbsScrollWrapper = document.getElementsByClassName("scroll_wrapper")[0];
var modalThumbsScrollWrapperHeight = modalThumbsScrollWrapper.offsetHeight;
var modalThumbsContainer = document.getElementsByClassName('thumbs_container')[0];
var modalThumbsContainerHeight = modalThumbsContainer.offsetHeight;
var modalThumbs = document.getElementsByClassName('thumbs')[0];
var modalThumbsHeight = modalThumbs.offsetHeight;
var scrollbarHeight = modalThumbsContainerHeight - modalThumbsHeight;
var newModalThumbsContainerHeight = modalThumbsScrollWrapperHeight + scrollbarHeight;
modalThumbsContainer.style.height = newModalThumbsContainerHeight + "px";
modalThumbsWidthCorrectionFF()
}
function modalThumbsWidthCorrectionFF(){
var modalThumbs = document.getElementsByClassName('thumbs');
var modalThumbsLength = modalThumbs.length;
var modalThumbsImgs = document.getElementsByClassName('thumbs_imgs');
for (var i = 0; i < modalThumbsLength; i++) {
modalThumbs[i].style.width = modalThumbsImgs[i].offsetWidth + "px";
}
}
.scroll_wrapper {
position: relative;
overflow: hidden;
height: 100px;
}
.thumbs_container {
position: absolute;
display: -webkit-box;
display: -moz-box;
display: -ms-flex;
display: -webkit-flex;
display: flex;
flex-flow: row nowrap;
overflow-x: scroll;
height: 100%;
width: 100%;
}
.thumbs {
display: -webkit-box;
display: -moz-box;
display: -ms-flex;
display: -webkit-flex;
display: flex;
flex-flow: column nowrap;
height: 100%;
}
.thumbs_imgs {
height: 100%;
object-fit: contain;
}
<div class="scroll_wrapper">
<div class="thumbs_container">
<div class="thumbs">
<img src="http://placeimg.com/170/110/any" alt="1" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/115/any" alt="2" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/120/any" alt="3" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/125/any" alt="4" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/130/any" alt="5" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/135/any" alt="6" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/135/any" alt="7" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/140/any" alt="8" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/145/any" alt="9" class="thumbs_imgs"/>
</div>
<div class="thumbs">
<img src="http://placeimg.com/170/150/any" alt="10" class="thumbs_imgs"/>
</div>
</div>
</div>
Below is the code :
I want to select the radio button which is present within the span class. Could you please help in identifying a successful xpath ?
<div id="quicklinkbox" class="col-md-2" data-position="left" data-intro="You can directly download payslip PDFs for the last 3 or 6 months. (India payslip only)" data-step="4">
<div style="background-color: transparent; margin-top: 28px;">
<div id="panel-title" ng-click="changeExpand(expand);" style="position: relative; left: 24px; cursor: pointer; font-weight: 500;">Quick Download</div>
<div id="panel-title" class="panel-body" style="text-align: left; font-weight: lighter; padding: 5px 0px 0px 50px; font-weight: 400">
<span style="margin-left: -16px;">Payslips for</span>
<form class="ng-pristine ng-valid">
<div class="form-group">
<div class="radio">
<span same-heightcol="" style="font-size: 16px;">
<input class="ng-pristine ng-valid" type="radio" ng-model="payslipselectedopt" style="cursor: pointer;" value="3" name="payslipradio"/>
<span style="font-size: 16px; position: relative; top: -5px;">Last 3 months</span>
</span>
</div>
<div class="radio">
<span style="font-size: 16px;">
<input class="ng-pristine ng-valid" type="radio" ng-model="payslipselectedopt" value="6" name="payslipradio" style="cursor: pointer;"/>
<span style="font-size: 16px; position: relative; top: -5px;"> Last 6 months</span>
</span>
</div>
<img style="margin-bottom: -12px; margin-left: -16px; cursor: pointer;" ng-click="downloadbulkpayslip()" src="appResources/images/Download-button.png"/>
</div>
</form>
</div>
</div>
</div>
</div>
You can use:
//span/input[#name='payslipradio' and #value='6']
Explanation:
//span -> Will search in all HTML al span tag
/input -> Will searth inside the span tag previous selected a input tag
[#name='payslipradio' and #value='6'] -> Will search in the previous selected tags one that the name attr is equals to 'pslpradio' and value attr equals to '6'
//*span[input#class='ng-pristine ng-valid' and #type='radio']))
Hi to everyone I have a strange problem with Firefox 46, before the update my website work good, now if I go over the slider on top page it doesn't show me the custom cursor and if I click on it doesn't work the jquery function too.
On chrome, safari and also on the old version of FF it work; it's seems it can't see the div #banner because it's a child of others div containers, but why on the old version it work?
I'm confused
here's the test page
HTML code
<div class="parallax">
<header>
<div id="cont_logo">
<a class="logo" href="" rel="home"></a>
<span>L'étoile</span>
<span id="logo_text">Ristorante - Pizzeria - Steak House</span>
<span>Courmayeur</span>
</div>
<nav id="menu_lang">
<ul>
<li class="selected"><a href="" title="ita" >It</a></li>
<li><a href="" title="fra" >Fr</a></li>
<li><a href="" title="eng" >En</a></li>
</ul>
</nav>
<nav id="main_menu">
<ul>
<li>Home</li>
<li class="selected">Ristorante</li>
<li>Menu</li>
<li>Courmayeur</li>
<li>News</li>
<li>Gallery</li>
</ul>
</nav>
</header>
<div class="parallax__group">
<div class="parallax__layer parallax__layer--base">
<div id="banner">
<ul>
<li><img src="images/banner1.jpg" alt="" /></li>
<li><img src="images/banner2.jpg" alt="" /></li>
<li><img src="images/banner3.jpg" alt="" /></li>
<li><img src="images/banner4.jpg" alt="" /></li>
</ul>
</div>
</div>
<div id="overlayer">
<h2>Ristorante</h2>
</div>
</div>
CSS code
#banner{
width:100%;
overflow:hidden;
z-index:0;
position:relative;
top:0;
left:-4px;
}
#banner:not(.home):hover{cursor:url("img/zoom.cur"), auto;}
.parallax {
height: 100%;
overflow-x: hidden;
overflow-y: auto;
perspective: 1px;
width: 100%;
}
.parallax__layer--base {
bottom: 0;
left: 0;
position: relative;
right: 0;
top: 0;
transform: translateZ(-1px) scale(2);
}
.parallax__layer--back {
transform: translateZ(0px);
}
.parallax__layer--content {
position: relative;
}
.parallax__group {
position: relative;
height: 100vh;
transform-style: preserve-3d;
}
JQuery code
function zoom_banner(){
$( "#banner" ).click(function() {
$("#testa_pag, #overlayer").toggleClass('open');
});
}
I think i found a strange bug in firefox.
When i have an hover class on a div with a background-size property (with a change in the opacity) the size of some of the image a use in the background, changes by one pixel in horizontal, or in vertical.
I made an example of the probleme here:
http://jsfiddle.net/xz4F8/
the html:
<div class="group cont_tutto">
<div class="conteiner_articoli_cinema">
<div class="back_navigazione_articoli-mag">
<div class="articolo_mag">
<div class="tipo-articoli-mag">speciale cinema</div>
<a href="http://www.google.it">
<div class="articolo_mag_cover" style="background-image:url('http://pu2.everyeye.it/public/immagini/16072013/Now-You-See-Me--I-maghi-del-crimine_articolo.jpg')"></div>
</a>
<div class="mag_titolo">
<h2>the lone ranger </h2>
</div>
</div>
<div class="articolo_mag">
<div class="tipo-articoli-mag">speciale cinema</div>
<a href="http://www.google.it">
<div class="articolo_mag_cover" style="background-image:url('http://pu2.everyeye.it/public/immagini/16072013/theloneranger384470.jpg')"></div>
</a>
<div class="mag_titolo">
<h2>the lone ranger </h2>
</div>
</div>
<div class="articolo_mag">
<div class="tipo-articoli-mag">rcensione fumetti</div>
<a href="http://www.google.it">
<div class="articolo_mag_cover" style="background-image:url('http://pu2.everyeye.it/public/immagini/16072013/Nodo-alla-gola_articolo.jpg')"></div>
</a>
<div class="mag_titolo">
<h2>the lone ranger </h2>
</div></div>
<div class="articolo_mag">
<div class="tipo-articoli-mag">recensione cinema</div>
<a href="http://www.google.it">
<div class="articolo_mag_cover" style="background-image:url('http://pu2.everyeye.it/public/immagini/15072013/Distribuzione-cinema-e-dvd_articolo.jpg')"></div>
</a>
<div class="mag_titolo">
<h2>the lone ranger </h2>
</div>
</div>
<div class="articolo_mag">
<div class="tipo-articoli-mag">recensione serie tv</div>
<a href="http://www.google.it">
<div class="articolo_mag_cover" style="background-image:url('http://pu2.everyeye.it/public/immagini/08072013/trueblood-stagione6309717.jpg')"></div>
</a>
<div class="mag_titolo">
<h2>the lone ranger </h2>
</div>
</div>
<div class="articolo_mag">
<div class="tipo-articoli-mag">recensione blu-ray</div>
<a href="http://www.google.it">
<div class="articolo_mag_cover" style="background-image:url('http://pu2.everyeye.it/public/immagini/13072013/ax967523.jpeg')"></div>
</a>
<div class="mag_titolo">
<h2>the lone ranger </h2>
</div>
</div>
<div class="articolo_mag">
<div class="tipo-articoli-mag">recensione cinema</div>
<a href="http://www.google.it">
<div class="articolo_mag_cover" style="background-image:url('http://pu2.everyeye.it/public/immagini/12072013/lareligiosa825433.jpg')"></div>
</a>
<div class="mag_titolo">
<h2>the lone ranger </h2>
</div>
</div>
</div>
</div>
</div>
The css:
#charset "utf-8";
/* CSS Document */
.articolo_mag {
background-color: #EFEFEF;
float: left;
width: 129px;
margin-right: 6px;
}
.articolo_mag_cover {
width: 129px;
height: 177px;
background-size:129px 177px;
background-color: #333;
}
.articolo_mag_cover:hover {
background-size:129px 177px;
opacity: 0.9;}
.mag_titolo {}
.mag_titolo h2 {display: table-cell;
vertical-align: middle;
background-color: #FFF;
font-size: 10px;
font-family: Lato, Arial;
font-weight: bold;
border: 1px solid #D9D9D9;
text-align: center;
text-transform: uppercase;
padding-top: 0px;
padding-bottom: 0px;
height: 30px;}
.mag_titolo h2:hover { color: #09F;
background-color: #E4E4E4;}
.mag_titolo h2 a {
display: block;
color: #000000;
text-decoration: none;
text-transform: uppercase;
width: 119px;
line-height: normal;
padding-right: 4px;
padding-left: 4px;
padding-bottom: 0px;
}
.tipo-articoli-mag {
background-color: rgba(0,0,0,0.75);
height: 17px;
width: 115px;
color: #FFF;
font-family: Lato, Arial;
font-size: 10px;
font-weight: bold;
padding-top: 3px;
padding-left: 5px;
text-transform: uppercase;
left: 5px;
z-index: 25;
position: relative;
float: left;
margin-top: 150px;
}
If i use the cover option for the background-size,the size problems seems attenuated, but, some of the images start to flicker during the update of the page, or the hover state (seems to me, firefox can't decide witch is the right size of the image )
It seems that the problem is triggered by the div container that i use to center all the content in my page (cont_tutto) witch has a 951px in width..
No problem at all on all the other browsers!
You had to add "-moz-backface-visibility: hidden" to solve the problem. Here is the solution: http://nickpye.com/2013/04/03/css3-opacity-transition-image-wiggle-bug-in-mozilla-firefox/
Try to add
transform: rotate(360deg);
somewhere as i did to the following image that was moving 1px when hover
.btnRoll:hover img {
filter: alpha(opacity=80);
opacity: 0.8;
transform: rotate(360deg);
}
I have recently experienced the same problem, which is the exact reason I have chosen to stick to the built in "Inspect Element" function in Firefox
Tanner