Foundation Orbit slider with responsive design - responsive-design

I have started using the Foundation 3 from zurb but my slider has slides with text on the left hand side and an image on the right (instead of just an image and a label on top of it).
When I decrease the size of the browser window it all fits except that the height of the slider.
What we need is to make the slider higher when on a small browser (it needs to be the same slider - not an alternative).
I know there's the fluid option in fluid slider and I suspect that if I change it, it will be enough to solve this problem.
How do I achieve that?
The following is my slider HTML code:
<div class="row">
<div class="twelve columns">
<div id="slider">
<!-- *** This is the slider that needs to fit smaller browsers ***-->
<div class="row" style="background-color:White;">
<div class="six columns">
<h2>Title</h2>
<div class="summary">
This is the summary is the summary is the summary is the summary is the summary is the summary is the summary.
Learn more
</div>
<div class="some-thumbnails">
<img src="http://placehold.it/100x100&text=[thumbnail]" />
<img src="http://placehold.it/100x100&text=[thumbnail]" />
<img src="http://placehold.it/100x100&text=[thumbnail]" />
</div>
</div>
<div class="six columns">
<img src="http://placehold.it/550x250&text=[img 1]" />
</div>
</div>
<img src="http://placehold.it/1000x400&text=[img 1]" />
</div>
</div>
<hr />

The orbit is controlled by an image generated by some plugin used by the orbit plugin. What I did was to change the plugin to get the height of the left and right part of the highest slide (when changed to phone view) and then set the data-src to "holder.js/[width]x[height]" and call the Holder.run() method.

Related

Using bootstrap 5 anchor text is about same size as label on PC and iPad but much larger on phone

I'm using Bootstrap 5, and in many places I combine a label and an anchor link, and I style the anchor link as small and fig-caption so you get a light gray link that is about the same size as the label.
This works okay on my PC and iPad, but on my phone the link is much larger than the label text.
Why is that, what is better way to do this so remains consistent for all platforms
<div class="row g-2 mb-2">
<div class="col">
<span class="ps-2">
<label>
All tracks composed by
</label>
<span>
<a href="/composer.start?cid=0$=Composer$2682&title=Composers+%2F+Johann+Sebastian+Bach" class="small figure-caption">
Johann Sebastian Bach
</a>
</span>
</span>
</div>
</div>
Update:Actually I have analysed the problem further and it turns out the issue that I have a heading near the top of the page, and if the heading is longer than the width of the screen I get the issue.
e.g
<div class="row g-0">
<div class="col mx-2">
<h4>
Albums / Albinoni; Vivaldi; Cimarosa: Venetian Oboe Concertos (Flac)
</h4>
</div>
I don't get the issue if I use h6 instead of h4 even when text is still wider than screen but then the text is smaller than I would like
I don't get the issue if I don't wrap within bootstrap row and column, if I just do:
<h4>Albums / Albinoni; Vivaldi; Cimarosa: Venetian Oboe Concertos (Flac)</h4>
then it works, but then I have the issue that I dont have the same margin to the left

angular-ui-grid nested in angular-ui-layout with 100% height

I am trying to show an angular-ui-grid in one of the containers/panes of an angular-ui-layout. The container should contain a toolbar at the top and the remaining space should be filled by either a chart or the corresponding data table which I tried to solve with a flexgrid and ng-include.
My problem is that I don't get the ui-grid to initialize correctly when first shown and it does not fill the remaining space. Also it does not reliably resize when I resize the browser window, sometimes it does not grow accordingly, sometimes it does not shrink usually it's the scrollbars that are misaligned.
I tried using handleWindowResize and ui-grid-auto-resize to no avail.
The ui-layout is this:
<div ui-layout="{flow : 'column'}" >
<div ui-layout-container size="20%">
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
</div>
<div ui-layout-container>
<div style="height:100%;display:flex;flex-flow:column;padding:10px">
<form role="form" style="padding-bottom:10px">
<label>Toolbar</label>
<button ng-click="showAnalysis1=true">Analysis 1</button>
<button ng-click="showAnalysis1=false">Analysis 2</button>
</form>
<form role="form" style="padding-bottom:10px">
<label>Sub-Toolbar</label>
<button ng-click="showChart=true">Show chart</button>
<button ng-click="setShowChart(false)">Show table</button>
</form>
<div class="analysis-container" ng-show="showAnalysis1" ng-include="'analysis1.html'">
</div>
<div class="analysis-container" ng-show="!showAnalysis1" ng-include="'analysis2.html'">
</div>
</div>
</div>
</div>
And the ui-grid is in an ng-include together with a dummy chart, f.e.
<div ng-show="showChart">
Here goes the chart for analysis 1...
</div>
<div ng-show="!showChart" class="my-grid-container">
<div ui-grid="tableOptions" class="my-grid" ui-grid-auto-resize>
</div>
</div>
The following plnkr shows this in context:
http://plnkr.co/edit/gIynXCdy7Kkyl0iwiBid?p=preview
To reproduce:
press either Analysis1 or Analysis2
press Show table
resize the browser window several times
Please ignore the ui-layout splitter for now. At the moment I am only interested in resizing the browser window and having the ui-grid fill the remaining space at all.
I see you have correctly added the directive ui-grid-auto-resize, but you also must specify it as a module dependency for your module:
angular.module('x', ['ui.layout', 'ui.grid','ui.grid.autoResize'])
http://plnkr.co/edit/8VmwsvBGnbtZNsjDL95C?p=preview

C3 graph displaying issue in Angular Material Layout

I have an strange issue with displaying graphs in AMD Layout.
There are two widgets in which I've defined graphs and here is how it looks like - you can see that graphs in widgets go out of their area
I've tried reproduce this bug in plunker and there is nothing wrong :/
When I make a small change in browser (for example, I move the edge of the browser), graphs return to the right place -> http://recordit.co/mRmNAjH840
<div layout="row" ng-controller="GraphCtrl" layout-md="column" layout-sm="column" layout-margin="">
<section class="widget md-whiteframe-z1 ng-isolate-scope md-cyan-theme" ng-class="{'widget-overlay-title': overlayTitle}" ng-attr-layout="{{widgetLayout}}" content-padding="" flex-gt-lg="66" flex-gt-md="66">
<div class="panel-heading">Widget1<span flex=""></span>
</div>
<div class="panel-body">
<div id="chart1"></div>
</div>
</section>
<section class="widget md-whiteframe-z1 ng-isolate-scope md-cyan-theme" ng-class="{'widget-overlay-title': overlayTitle}" ng-attr-layout="{{widgetLayout}}" content-padding="" flex-gt-lg="32" flex-gt-md="32">
<div class="panel-heading">Widget2<span flex=""></span>
</div>
<div class="panel-body">
<div id="c3_combined"></div>
</div>
</section>
</div>
I'm not sure if this is related to your problem, but on IE, I have to add this CSS property manually :
svg { overflow: hidden; }

How can I use angular ng-repeat to generate rows of 4?

I have a simple ng-repeat generating image divs. I want them to come out in rows of 4 instead of one long vertical list. How can I do this?
<div ng-repeat="artist in artists">
<div>
<h3> {({ artist.fields.title })} </h3>
<img src="{({ artist.fields.link })}" />
</div>
</div>
I believe you want to do something like this
<div style="width:800px;">
<div ng-repeat="artist in artists" style="width:200px;float:left;">
<div>
<h3> {({ artist.fields.title })} </h3>
<img src="{({ artist.fields.link })}" />
</div>
</div>
</div>
By having a container with a fixed width, and having each element inside be 1/4 of that width you can achieve what you want.
Of course, inline styles shouldn't be used in real code :)
You can use the $index property to add a tag every 4th item. Then use some CSS to display items as desired:
<div ng-repeat="artist in artists">
<div class="someClass">
<h3> {({ artist.fields.title })} </h3>
<img src="{({ artist.fields.link })}" />
</div>
<br ng-if="artist.$index % 4 == 0" />
</div>
One way is to use css properties. attach a class to the div with a float:left attribute, and insert a br tag after every 4th div
I guess you are using bootstrap?
If yes, this thread could do a help:
Bootstrap's grid columns number per row
doc for bootstrap grid layout:
http://getbootstrap.com/css/#grid-example-mixed

Zurb responsive image size doesn't work

I use zurb and I have 1 row and 4 columns and I have 4 images inside those 4 columns.
Images are not all of the same size, so in prior to get pictures 100% sharpness, I have to give them width and height for each.
I would like to ask which class do I have to use and how, that would make my images responsive(ratio) while I am decreasing the size of my browser window, and with that, size of columns, which are responsive?
This is my code:
<div class="row">
<div class="three columns">
<img src="something.jpg" style="width:220px; height:200px;" />
</div>
<div class="three columns">
<img src="something.jpg" style="width:223px; height:190px;" />
</div>
<div class="three columns">
<img src="something.jpg" style="width:210px; height:150px;" />
</div>
<div class="three columns">
<img src="something.jpg" style="width:210px; height:195px;" />
</div>
</div>
I don't use inline CSS, it's just an example for width and height.
Thank you.
I somehow had this part commented inside .css:
/* line 45, ../../../../../../../../Library/Ruby/Gems/1.8/gems/zurb-foundation-3.0.4/stylesheets/foundation/grid.scss */
img, object, embed {
max-width: 100%;
height: auto;
}
With this my images are responsive.

Resources