I am using angularjs to render my html and using bootstrap 3 to style it. The tabs render correctly, but the images within each tab do not display in a grid, rather, they are outputted one by one in a single column. What am I doing wrong?
<div class="col-sm-12">
<!--Nav Tabs-->
<ul class="nav nav-tabs" role="tablist">
<li class="active"><a href="{{'#' + retailProducts[0].Category}}"
role="tab" data-toggle="tab">
{{retailProducts[0].Category}}
</a></li>
<li ng-repeat="pro in retailProductsMinusFirst">
<a href="{{'#' + pro.Category}}" role="tab" data-toggle="tab">
{{pro.Category}}
</a>
</li>
</ul>
<!--Tab Panes-->
<div class="tab-content">
<div class="tab-pane active" id="{{retailProducts[0].Category}}">
<div class="row">
<div class="col-sm-2">
<a ng-repeat="pro in retailProducts[0].Products" href="#"
class="thumbnail">
<img src="{{pro.Product.PrimaryPhotoUrl + '?height=100'}}"
alt="Product Photo" />
</a>
</div>
</div>
</div>
<div ng-repeat="pro in retailProductsMinusFirst" class="tab-pane"
id="{{pro.Category}}">
<div class="row">
<div class="col-sm-2">
<a ng-repeat="img in pro.Products" href="#" class="thumbnail">
<img src="{{img.Product.PrimaryPhotoUrl + '?height=100'}}"
alt="Product Photo" />
</a>
</div>
</div>
</div>
</div>
</div>
You're repeating the anchors. You need to repeat the column divs. Something like this:
<div ng-repeat="pro in retailProducts[0].Products" class="col-sm-2">
<a href="#" class="thumbnail">
<img src="{{pro.Product.PrimaryPhotoUrl + '?height=100'}}"
alt="Product Photo" />
</a>
</div>
Related
I have the following issue:
FULL CODE: jsfiddle
HTML part:
<div class="gc-tabs">
<!-- importar icones em cada aba -->
<ul id="home-tabs-menu" class="nav nav-tabs">
<li class="most-read active">
<a href="#mais-vistas">
<img class="center-block" src="http://guiadacozinha.app/wp-content/themes/gc/assets/images/svg/most-read.svg" />
Mais Vistas
</a>
</li>
<li class="best-rated">
<a href="#melhor-avaliadas"><img class="center-block" src="http://guiadacozinha.app/wp-content/themes/gc/assets/images/svg/best-rated.svg" />
Melhor avaliadas
</a>
</li>
<li class="most-commented">
<a href="#mais-comentadas">
<img class="center-block" src="http://guiadacozinha.app/wp-content/themes/gc/assets/images/svg/most-commented.svg" />
Mais comentadas
</a>
</li>
</ul>
<div class="tab-content">
<div id="mais-vistas" class="tab-pane fade in active">
<a href="#" class="recipe-card">
<div class="recipe-img">
<img src="http://guiadacozinha.app/wp-content/themes/gc/assets/images/img-teste.png" />
</div>
<div class="recipe-desc">
<h3 class="recipe-title">Petit gâteau de caneca</h3>
<div>rating</div>
<span>Fácil</span>
<span>45min</span>
</div>
</a>
<a href="#" class="recipe-card">
<div class="recipe-img">
<img src="http://guiadacozinha.app/wp-content/themes/gc/assets/images/img-teste.png" />
</div>
<div class="recipe-desc">
<h3 class="recipe-title">Petit gâteau de caneca</h3>
<div>rating</div>
<span>Fácil</span>
<span>45min</span>
</div>
</a>
<a href="#" class="recipe-card">
<div class="recipe-img">
<img src="http://guiadacozinha.app/wp-content/themes/gc/assets/images/img-teste.png" />
</div>
<div class="recipe-desc">
<h3 class="recipe-title">Petit gâteau de caneca</h3>
<div>rating</div>
<span>Fácil</span>
<span>45min</span>
</div>
</a>
</div>
<div id="melhor-avaliadas" class="tab-pane fade">
<h3>Melhor avaliada #1</h3>
<img src="http://guiadacozinha.app/wp-content/themes/gc/assets/images/img-teste.png" />
</div>
<div id="mais-comentadas" class="tab-pane fade">
<h3>Mais comentada #1</h3>
<img src="http://guiadacozinha.app/wp-content/themes/gc/assets/images/img-teste.png" />
</div>
</div>
</div>
FULL CODE: https://jsfiddle.net/Lqp1g1ge/
I need the 3 navigation icons to be centered and occupy all the space like that:
Can you help me, please?
Simplest fix, set the CSS like so. Please note I have added my own images since the images provided don't work.
CSS3:
ul#home-tabs-menu{
display:flex;
}
ul#home-tabs-menu li{
display:flex;
align-items:center;
flex-grow:1;
height:100%;
}
ul#home-tabs-menu li>a{
text-align:center;
width:100%;
}
JSFiddle Demo
We are building a simple website in CSS to provide educational resources for other students here at my school. I have chosen to go with the Bootstrap Columns. The problem is on our school's desktop computers and tablets stacks the columns into different rows, instead of just shrinking the size down.
Here is all of the relevant HTML code:
<!-- Left Side Bar -->
<div style="background-color:#F3F8FC;" class="col-lg-2 mobile-hide" ><!-- Not Displayed on Mobile -->
<div class="fotd">
<div class="fotd-title">
<h4>Fact Of The Day</h4>
</div>
<p>Text</p>
</div>
<div class="twitter mobile-hide">
<a class="twitter-timeline" href="https://twitter.com/RHL_Inspire" data-widget-id="720721136867282945">Tweets by #RHL_Inspire</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
</div>
<!-- Center Content -->
<div class="col-lg-7 ">
<h3 class="content title">Letter from The Editor In Narwhal</h3>
<p class="content" >
This is a link. This is the actual link
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam lobortis,
</p>
</div>
<!-- Right Side -->
<div style="background-color:#F3F8FC;" class="col-lg-3 mobile-hide">
<h3 class ="center mobile-hide">Editors Picks!</h3>
<ul class="stickynote mobile-hide">
<li class="stickynote mobile-hide">
<a class="stickynote" href="http://www.google.com">
Google
</a>
</li>
<li class="stickynote">
<a class="stickynote" href="http://www.google.com">
Google
</a>
</li>
<li class="stickynote">
<a class="stickynote" href="http://www.google.com">
Google
</a>
</li>
<li class="stickynote">
<a class="stickynote" href="http://www.google.com">
Google
</a>
</li>
<li class="stickynote">
<a class="stickynote" href="http://www.google.com">
Google
</a>
</li>
<li class="stickynote">
<a class="stickynote" href="http://www.google.com">
Google
</a>
</li>
</ul>
</div>
<div class="row">
<div class="col-lg-12">
<footer>© 2016 The StickyNote | Google</footer>
</div>
</div>
The issue was that we had to change the code to specify two sizes of the column. For example in the original code we had:
<div style="background-color:#F3F8FC;" class="col-lg-7">
This had to be simply changed to:
<div style="background-color:#F3F8FC;" class="col-lg-7 col-sm-7">
The col-sm-7 gets used for smaller screens(such as Tablets and the lower-res desktop computers.
I am trying to parse some data and images from controller to show on view. I implemented a foreach loop to show some images in slideshow. But whenever I run the code only the first image appears inside the body, and other images and information goes below the footer. I am not getting what mistake I made in this code.
My code is-
<div class="row wrapper border-bottom white-bg page-heading">
<div class="col-lg-10">
<h2>#ViewBag.Title</h2>
<ol class="breadcrumb">
<li class="active">
Back
</li>
</ol>
</div>
</div>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Search</title>
</head>
<body>
<div>
#foreach (var item in ViewBag.Cities) {
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>#item.Name</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-wrench"></i>
</a>
</div>
</div>
<div class="ibox-content">
<p>#item.Shorttext</p>
</div>
</div>
</div>
foreach (var image in item.Images) {
<div class="col-lg-5">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>Animation without caption</h5>
</div>
<div class="ibox-content">
<div class="carousel slide" id="carousel1">
<div class="carousel-inner">
<div class="item active">
<img alt="image" class="img-responsive" src="#image" style="height:400px;width:600px">
</div>
</div>
<a data-slide="prev" href="#carousel1" class="left carousel-control">
<span class="icon-prev"></span>
</a>
<a data-slide="next" href="#carousel1" class="right carousel-control">
<span class="icon-next"></span>
</a>
</div>
</div>
</div>
</div>
} }
</div>
</body>
</html>
My view is looking like this.
Hope it will solve your issue.
<div class="col-lg-10">
<h2>#ViewBag.Title</h2>
<ol class="breadcrumb">
<li class="active">
Back
</li>
</ol>
</div>
</div>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Search</title>
</head>
<body>
<div>
#foreach (var item in ViewBag.Cities) {
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>#item.Name</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-wrench"></i>
</a>
</div>
</div>
<div class="ibox-content">
<p>#item.Shorttext</p>
</div>
</div>
</div>
}
foreach (var image in item.Images) {
<div class="col-lg-5">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>Animation without caption</h5>
</div>
<div class="ibox-content">
<div class="carousel slide" id="carousel1">
<div class="carousel-inner">
<div class="item active">
<img alt="image" class="img-responsive" src="#image" style="height:400px;width:600px">
</div>
</div>
<a data-slide="prev" href="#carousel1" class="left carousel-control">
<span class="icon-prev"></span>
</a>
<a data-slide="next" href="#carousel1" class="right carousel-control">
<span class="icon-next"></span>
</a>
</div>
</div>
</div>
</div>
}
</div>
</body>
</html>
I would like to have three single column list-group's on my page and allow the user to select an item from each group. However, the list-groups are all linked and I haven't been able to figure out how to keep them as individual list-groups.
I setup up a quick Plunker link here so you could see what I'm trying to do.
I'm also not sure why each column of lists is offset by the previous column.
Here's the HTML that I'm playing with as I try to figure out how to do this:
<div class="container">
<h3>
Select one from each column.
</h3>
<div>
<h3 class="list-group-item-heading">Select Opp</h3>
</div>
<div id="oppname" class="col-md-4 list-group">
<div class="no-margin">
<a href="#" class="list-group-item">
Aelia
</a>
</div>
<div class="no-margin">
<a href="#" class="list-group-item">
Del Monte
</a>
</div>
</div>
<div>
<h3 class="list-group-item-heading">Select Id</h3>
</div>
<div id="oppid" class="col-md-4 list-group">
<div class="no-margin">
<a href="#" class="list-group-item">
Id: 1724
</a>
<div class="no-margin">
<a href="#" class="list-group-item">
Id: 1675
</a>
</div>
</div>
</div>
<div>
<h3 class="list-group-item-heading">Select Size</h3>
</div>
<div id="oppsize" class="col-md-4 list-group">
<div class="no-margin">
<a href="#" class="list-group-item">
Size: 24
</a>
<div class="no-margin">
<a href="#" class="list-group-item">
Size: 75
</a>
</div>
</div>
</div>
</div>
Thanks for you help!
Yes, its weird that it doesn't work by default groupings.
Here is a solution in Fiddle
<div class="list-group">
One
Two
Three
</div>
<div class="list-group">
One
Two
Three
</div>
<div class="list-group">
One
Two
Three
</div>
and add this sibling js to do the selection like this
$('body').on('click', '.list-group a', function (e) {
$(this).addClass('active');
$(this).siblings().removeClass('active');
});
and Viola.
I use this to load a page and replace the current page:
$.get('genres.html').done(function (data) {
$('#pagecontent').html(data);
})
When i do this everything in de body gets replaced with the new content.
I need to replace the full body except this footer.
I did see something about div:not but i think thats not working with ajax.
How can i replace everything except the footer:
<footer class="footer bg-dark">
<div id="jp_container_N">
<div class="jp-type-playlist">
<div id="jplayer_N" class="jp-jplayer hide"></div>
<div class="jp-gui">
<div class="jp-video-play hide"><a class="jp-video-play-icon">play</a></div>
<div class="jp-interface">
<div class="jp-controls">
<div><a class="jp-previous"><i class="icon-control-rewind i-lg"></i></a>
</div>
<div><a class="jp-play"><i class="icon-control-play i-2x"></i></a>
<a class="jp-pause hid"><i class="icon-control-pause i-2x"></i></a>
</div>
<div><a class="jp-next"><i
class="icon-control-forward i-lg"></i></a></div>
<div class="hide"><a class="jp-stop"><i class="fa fa-stop"></i></a>
</div>
<div><a class="" data-toggle="dropdown" data-target="#playlist"><i
class="icon-list"></i></a></div>
<div class="jp-progress hidden-xs">
<div class="jp-seek-bar dk">
<div class="jp-play-bar bg-info"></div>
<div class="jp-title text-lt">
<ul>
<li></li>
</ul>
</div>
</div>
</div>
<div class="hidden-xs hidden-sm jp-current-time text-xs text-muted"></div>
<div class="hidden-xs hidden-sm jp-duration text-xs text-muted"></div>
<div class="hidden-xs hidden-sm"><a class="jp-mute" title="mute"><i
class="icon-volume-2"></i></a> <a class="jp-unmute hid"
title="unmute"><i
class="icon-volume-off"></i></a></div>
<div class="hidden-xs hidden-sm jp-volume">
<div class="jp-volume-bar dk">
<div class="jp-volume-bar-value lter"></div>
</div>
</div>
<div><a class="jp-shuffle" title="shuffle"><i
class="icon-shuffle text-muted"></i></a> <a
class="jp-shuffle-off hid" title="shuffle off"><i
class="icon-shuffle text-lt"></i></a></div>
<div><a class="jp-repeat" title="repeat"><i
class="icon-loop text-muted"></i></a> <a
class="jp-repeat-off hid" title="repeat off"><i
class="icon-loop text-lt"></i></a></div>
<div class="hide"><a class="jp-full-screen" title="full screen"><i
class="fa fa-expand"></i></a> <a class="jp-restore-screen"
title="restore screen"><i
class="fa fa-compress text-lt"></i></a></div>
</div>
</div>
</div>
<div class="jp-playlist dropup" id="playlist">
<ul class="dropdown-menu aside-xl dker">
<!-- The method Playlist.displayPlaylist() uses this unordered list -->
<li class="list-group-item"></li>
</ul>
</div>
<div class="jp-no-solution hide"><span>Update Required</span> To play the media
you will need to either update your browser to a recent version or update
your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash
plugin</a>.
</div>
</div>
</div>
</footer>
Just put everything outside the footer in a container, then replace the contents of that. Something like:
<div id="content">
...your content here
</div>
<footer>
</footer>
Then do:
$.get('genres.html').done(function (data) {
$('#content').html(data);
})