Offcanvas menu - CSS transition not working on iphone 3 & 4 - ios

I am building a site with an off canvas menu just looked at it on an iphone 3 and 4 via Browser Stack but when I click on the nav trigger icon the menu isn't sliding in from the right, or should I say the main content isn't sliding to the left to reveal the menu. It's working on the 4S and above so it seems it won't work on iOS 3, 4 and 5 but does on 6 and above
I've used the auto prefixer in Brackets which added the webkit prefix but that still didn't work.
I'd greatly appreciate any help.
Here's the code:
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<div class="nav-trigger-container">
<label class="ion-navicon" for="nav-trigger"></label>
</div>
<!-- HERO BOX -->
<div class="site-wrap">
<header>
<div class="row">
<div class="hero-text-box">
<h1>Creative zest</h1>
<h2>for print & web.</h2>
<blockquote>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam semper, enim in fermentum facilisis, enim sem sollicitudin leo, ut tincidunt eros dui eget felis.</p></blockquote>
<cite>Sheryn Moore » Implementation Manager » Wesleyan brand refesh</cite>
</div>
</div>
</header>
<!-- ABOUT ME -->
<section class="freelance-graphic-designer-marc-lemmon">
<div class="row">
<h2>Senior Creative Design Consultant<br/>
& UI Developer</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse non diam mollis, mollis dui nec, molestie massa. Ut consectetur tempor nunc vitae interdum. Fusce vel diam ac tortor auctor commodo non ut metus. Donec sollicitudin augue pretium, semper nisi vitae, ultrices diam. </p>
</div>
</section>
**CSS**
/* ----- Moving the nav trigger to the right when it is clicked ----- */
.nav-trigger:checked + label {
right: 220px;
}
/* ----- Moving the content wrapper to the right when menu icon is clicked ----- */
.nav-trigger:checked ~ .site-wrap {
right: 200px;
box-shadow: 0 0 5px 5px rgba(0,0,0,0.5);
}
/* ----- Creating the smooth slide action ----- */
.nav-trigger + label, .site-wrap {
-webkit-transition: right 0.2s;
transition: right 0.2s;
}
Thanks in advance.
Marc

Does the transition property that you are animating "right" have a defined starting value for the 'label' and 'site-wrap' elements? When you are trying to transition the right/left properties you need to also define it's default starting value, otherwise it will default to 'auto'.
Maybe this will fix it:
.nav-trigger + label, .site-wrap {
-webkit-transition: right 0.2s;
transition: right 0.2s;
right:0;
}

Related

Angular Material: Why does mat-form does not wrap the mat-hint inside?

I want my form fields to look right. However, the hint text of a first field intersects the second field below it and the text appears dirty. My goal is to separate these overlapping texts.But I haven't found a solution yet. How can I solve this problem?
I don't want the form to look like in the picture.
Edit: I'm using the method suggested on his Angular official site.
https://stackblitz.com/angular/lnkmogrbgry?file=app%2Fform-field-overview-example.ts
Edit 2:
userform.component.html
<div class="col-lg-8 mx-auto mt-5">
<mat-card class="fullbar">
<div class="card-header-bar">
New User Form!
</div>
<mat-card-content class="mt-3 card-content-bar">
<form [formGroup]="userGroup">
<mat-form-field class="full-width">
<input matInput placeholder="Username" formControlName="username">
<mat-hint>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent nibh dui, viverra quis lacinia
non, volutpat vel nisi. Donec fringilla, sem id vestibulum semper, diam ligula venenatis ligula, nec
malesuada nisi mi at lectus.
</mat-hint>
</mat-form-field>
<mat-form-field class="full-width">
<input matInput placeholder="Password" formControlName="password">
<mat-hint>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent nibh dui, viverra quis lacinia
non, volutpat vel nisi. Donec fringilla, sem id vestibulum semper, diam ligula venenatis ligula, nec
malesuada nisi mi at lectus.
</mat-hint>
</mat-form-field>
<mat-form-field class="full-width">
<input matInput placeholder="Age" formControlName="age">
<mat-hint>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent nibh dui, viverra quis lacinia
non, volutpat vel nisi. Donec fringilla, sem id vestibulum semper, diam ligula venenatis ligula, nec
malesuada nisi mi at lectus.
</mat-hint>
</mat-form-field>
</form>
</mat-card-content>
</mat-card>
</div>
userform.component.css
.fullbar {
padding: 0px;
margin: 0px;
margin-top: 75px;
margin-bottom: 225px;
}
.card-header-bar {
line-height: 50px;
height: 50px;
max-height: 50px;
vertical-align: middle;
padding-left: 15px;
color: rgba(0, 0, 0, .54);
background-color: #e7e5f7;
}
.card-content-bar {
padding: 15px;
}
.full-width {
width: 100%;
}
I guess you need to set height of mat-form-field to auto.

Issues with CSS position: fixed in iOS 9 iPhone 6+ in landscape mode

I found a weird issue with my fixed header under the following conditions:
iphone 6+, landscape mode
safari, at least two tabs opened
my page has a position: fixed header and a body and html with position: relative, height: 100%
After page loads and when scrolling down, all works good, the header is in place and web inspector shows it correctly:
But when you scroll up and pull the page down the screen and release, the header is still visible on the page, but actually it is shifted somewhere below the viewport (see that web inspector does not highlight it).
This fact results in all header elements being unaccessible: you cannot open the menu, click on the logo, or contact button.
The header goes back to normal when:
you scroll down (but breaks again when you scroll back up)
switch to another tab and back
or close other tabs
I tried changing DOM or/and CSS of the header and body, but nothing puts the header back to normal state.
Any thoughts on how it can be fixed?
I am sorry to be the messenger of bad news, but I have no idea what your actual problem is since you posted no actual code. However, I would guess that since your problem is position:fixed, the best way to fix it is by stopping using position:fixed as it seems to not be working for you. Here is how you can equally-smoothly emulate it using only absolute and relative positioning:
<html id="eHTML">
<style>
#eHTML { position: static }
#eBODY { position: relative; overflow:hidden }
#eHTML, #eBODY, #main { width: 100%; height: 100%; margin: 0; top: 0 }
#eBODY>div { position:absolute; left:0;bottom:0 }
#footer {height: 20%;background-color:#88f;width:calc(100% - 14px)/*to account in for 14px scrollbar*/;overflow:hidden}
#main {background-color:#ff8;width:100%;height:100%;overflow:auto}
</style>
<body id=eBODY>
<div id=main>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
<p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p>
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium,</p>
<p>totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p>
<p>Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.</p>
<p>Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit,</p>
<p>sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.</p>
<p>Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?</p>
<p>Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur,</p>
<p>vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
<br /><br /><br /><br />
</div>
<div id="footer">
Some Random Fixed<br />
Content! Yay, it workz!
</div>
</body>
</html>

Rotativa and Bootstrap Grid Styling

I am working on an ASP.NET MVC 5 project and using Rotativa to generate PDF documents from Razor views.
I can't seem to get Rotativa to render the the view properly using Bootstrap styling. I'm trying to style the view using the simple grid layout that Bootstrap does so well. Nothing too fancy.
Here is a screenshot of my Razor View:
Here is a screen shot of the PDF:
And here is my view's content:
#{
Layout = null;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h1>Hello World!</h1>
<p>Resize the browser window to see the effect.</p>
<div class="row">
<div class="col-sm-6" style="background-color:lavender;">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<p> Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<div class="col-sm-6" style="background-color:lavenderblush;">
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p>
</div>
</div>
</div>
</body>
</html>
Has any one else been able to get this working?
I had a same issue.
Try to use col-xs-# instead col-md-# / col-sm-#, that works for me perfectly.
You should set correct page size and take care of resolution and Bootstrap breakpoints when shrinking browser window.
From the screenshot I can see the you get mobile output when converted to PDF; that means Bootstrap has detected small page size and it adjusts style accordingly. Default Rotativa page size is A4, I think.
I have found a workaround here.
After html
<div class="row printDetails">
<div class="col-5" style="background-color:lavender;">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<p> Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<div class="col-6" style="background-color:lavenderblush;">
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p>
</div>
</div>
you should make a css class to display inline block. So in your case:
.printDetails > div {
display: inline-block;
}
Also notice the row amount is 5 and 6 or 5 and 5 depending on the page size, some of the width goes for pdf size margin which is weird why it doesn't get the exact size as mobile version which is taking Rotativa.
Hope it helps someone.
Update
As #Erdogan replied, and after checking his link I tested the code that he probably thought I have to check.. I'm referencing here the code:
just added a CSS class at the same level as uk-grid called "flexrow" and another one for my divs.
.flexrow {
display: -webkit-box;
display: -webkit-flex;
display: flex !important;
}
.flexrow > div {
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
}
Got this: Here in some of the comments
For bootstrap 3, Do the following:
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
another tags ...
</div>
For bootstrap 4, Do the following:
<div class="col-6 col-sm-6 col-md-6 col-lg-6">
another tags ...
</div>
For bootstrap4 add the following styles
.flexrow {
display: -webkit-box;
display: -webkit-flex;
display: flex !important;
}
.flexrow > div {
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
}
Then add flexrow beside each row class in the HTML
<div class="row flexrow"> </div>
Thanks to link

tinyMCE is not defined

I using TinyMCE in ASP.NET MVC 3 but I think this is not a problem.
Error:
jquery-1.9.0.min.js:3Uncaught ReferenceError: tinyMCE is not defined
localhost:67678/Scripts/jquery-1.9.0.min.js
<!-- TinyMCE -->
<script type="text/javascript" src="~/Scripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
mode: "textareas",
theme: "simple"
});
</script>
<!-- /TinyMCE -->
<h3>
Simple theme example</h3>
<p>
This page shows you the simple theme and it's core functionality you can extend
it by changing the code use the advanced theme if you need to configure/add more
buttons etc. There are more examples on how to use TinyMCE in the <a href="http://tinymce.moxiecode.com/examples/">
Wiki</a>.
</p>
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
<p>
This is some example text that you can edit inside the <strong>TinyMCE editor</strong>.
</p>
<p>
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
</p>
</textarea>
<br />
<input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" />
<script type="text/javascript">
if (document.location.protocol == 'file:') {
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
}
</script>
Image:
fixed:
this is working
../../Scripts/tiny_mce/tiny_mce.js
my question is why this does not work? and why VS 2010 doesn`t show error with path?
~/Scripts/tiny_mce/tiny_mce.js
Correct Answer -> ../../Scripts/tiny_mce/tiny_mce.js

How do you make a Jquery Tab both mouseover and yet click to open the page?

it wont let me submit more than one link, so please use your imagination, i need multiple tabs with mutliple mouse overs or images so that thing in the middle is an image
<script type="text/javascript">
$(function() {
$("#tabs").tabs({event: 'mouseover'}).addClass('ui-tabs-vertical ui-helper-clearfix');
$("#tabs li").removeClass('ui-corner-top').addClass('ui-corner-right');
$('.openpage').click(function(){
window.location=$(this).attr('title');
});
});
</script>
<div id="tabs">
<ul>
<li>content1</li>
</ul>
<div id="tabs-1"><imgimg src="/images/1.jpg" alt=""></div>
</div>
This code is taken from jQuery Docs.
HTML code. Note that I've added classes for tabs.
<div id="tabs">
<ul>
<li class="tab1"><span>One</span></li>
<li class="tab2"><span>Two</span></li>
<li class="tab3"><span>Three</span></li>
</ul>
<div id="fragment-1">
<p>First tab is active by default:</p>
<pre><code>$('#example').tabs();</code></pre>
</div>
<div id="fragment-2">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
</div>
<div id="fragment-3">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
</div>
</div>
Now, if you want to add multiple effects on tabs, all you have to do is the following:
$(document).ready(function(){
$("#tabs").tabs();
$("#tabs .tab1").click(function() { alert('hello world'); });
});
I've not tested this, but I think it should work.

Resources