Summernote('code') is not working for pulling the data - summernote

scope.initializeSummernote = function() {
$('.summernoteWYSWIG').summernote({
placeholder: 'Enter your message place images and videos...',
onChange: scope.updateMessage
});
};
var summernoteVariable = $('.summernoteWYSWIG').summernote('code');
#font-face{font-family:"summernote";font-style:normal;font-weight:normal;src:url("font/summernote.eot?546c01739436985e5a21a8cb325521f3");src:url("font/summernote.eot?#iefix") format("embedded-opentype"),url("font/summernote.woff?546c01739436985e5a21a8cb325521f3") format("woff"),url("font/summernote.ttf?546c01739436985e5a21a8cb325521f3") format("truetype")}[class^="note-icon-"]:before,[class*=" note-icon-"]:before{display:inline-block;font:normal normal normal 14px summernote;font-size:inherit;-webkit-font-smoothing:antialiased;text-decoration:inherit;text-rendering:auto;text-transform:none;vertical-align:middle;speak:none;-moz-osx-font-smoothing:grayscale}.note-icon-align-center:before{content:"\f101"}.note-icon-align-indent:before{content:"\f102"}.note-icon-align-justify:before{content:"\f103"}.note-icon-align-left:before{content:"\f104"}.note-icon-align-outdent:before{content:"\f105"}.note-icon-align-right:before{content:"\f106"}.note-icon-align:before{content:"\f107"}.note-icon-arrows-alt:before{content:"\f108"}.note-icon-bold:before{content:"\f109"}.note-icon-caret:before{content:"\f10a"}.note-icon-chain-broken:before{content:"\f10b"}.note-icon-circle:before{content:"\f10c"}.note-icon-close:before{content:"\f10d"}.note-icon-code:before{content:"\f10e"}.note-icon-eraser:before{content:"\f10f"}.note-icon-font:before{content:"\f110"}.note-icon-frame:before{content:"\f111"}.note-icon-italic:before{content:"\f112"}.note-icon-link:before{content:"\f113"}.note-icon-magic:before{content:"\f114"}.note-icon-menu-check:before{content:"\f115"}.note-icon-minus:before{content:"\f116"}.note-icon-orderedlist:before{content:"\f117"}.note-icon-pencil:before{content:"\f118"}.note-icon-picture:before{content:"\f119"}.note-icon-question:before{content:"\f11a"}.note-icon-redo:before{content:"\f11b"}.note-icon-special-character:before{content:"\f11c"}.note-icon-square:before{content:"\f11d"}.note-icon-strikethrough:before{content:"\f11e"}.note-icon-subscript:before{content:"\f11f"}.note-icon-summernote:before{content:"\f120"}.note-icon-superscript:before{content:"\f121"}.note-icon-table:before{content:"\f122"}.note-icon-text-height:before{content:"\f123"}.note-icon-trash:before{content:"\f124"}.note-icon-underline:before{content:"\f125"}.note-icon-undo:before{content:"\f126"}.note-icon-unorderedlist:before{content:"\f127"}.note-icon-video:before{content:"\f128"}.note-editor{position:relative}.note-editor .note-dropzone{position:absolute;z-index:100;display:none;color:#87cefa;background-color:white;opacity:.95}.note-editor .note-dropzone .note-dropzone-message{display:table-cell;font-size:28px;font-weight:bold;text-align:center;vertical-align:middle}.note-editor .note-dropzone.hover{color:#098ddf}.note-editor.dragover .note-dropzone{display:table}.note-editor .note-editing-area{position:relative}.note-editor .note-editing-area .note-editable{outline:0}.note-editor .note-editing-area .note-editable sup{vertical-align:super}.note-editor .note-editing-area .note-editable sub{vertical-align:sub}.note-editor.note-frame{border:1px solid #a9a9a9}.note-editor.note-frame.codeview .note-editing-area .note-editable{display:none}.note-editor.note-frame.codeview .note-editing-area .note-codable{display:block}.note-editor.note-frame .note-editing-area{overflow:hidden}.note-editor.note-frame .note-editing-area .note-editable{padding:10px;overflow:auto;color:#000;background-color:#fff}.note-editor.note-frame .note-editing-area .note-editable[contenteditable="false"]{background-color:#e5e5e5}.note-editor.note-frame .note-editing-area .note-codable{display:none;width:100%;padding:10px;margin-bottom:0;font-family:Menlo,Monaco,monospace,sans-serif;font-size:14px;color:#ccc;background-color:#222;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;box-shadow:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;resize:none}.note-editor.note-frame.fullscreen{position:fixed;top:0;left:0;z-index:1050;width:100%!important}.note-editor.note-frame.fullscreen .note-editable{background-color:white}.note-editor.note-frame.fullscreen .note-resizebar{display:none}.note-editor.note-frame .note-statusbar{background-color:#f5f5f5;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.note-editor.note-frame .note-statusbar .note-resizebar{width:100%;height:8px;padding-top:1px;cursor:ns-resize}.note-editor.note-frame .note-statusbar .note-resizebar .note-icon-bar{width:20px;margin:1px auto;border-top:1px solid #a9a9a9}.note-editor.note-frame .note-placeholder{padding:10px}.note-popover.popover{max-width:none}.note-popover.popover .popover-content a{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.note-popover.popover .arrow{left:20px!important}.note-popover .popover-content,.panel-heading.note-toolbar{padding:0 0 5px 5px;margin:0}.note-popover .popover-content>.btn-group,.panel-heading.note-toolbar>.btn-group{margin-top:5px;margin-right:5px;margin-left:0}.note-popover .popover-content .btn-group .note-table,.panel-heading.note-toolbar .btn-group .note-table{min-width:0;padding:5px}.note-popover .popover-content .btn-group .note-table .note-dimension-picker,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker{font-size:18px}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher{position:absolute!important;z-index:3;width:10em;height:10em;cursor:pointer}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted{position:relative!important;z-index:1;width:5em;height:5em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted{position:absolute!important;z-index:2;width:1em;height:1em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIjd6vvD2f9LKLW+AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKwNDEVT0AAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover-content .note-style h1,.panel-heading.note-toolbar .note-style h1,.note-popover .popover-content .note-style h2,.panel-heading.note-toolbar .note-style h2,.note-popover .popover-content .note-style h3,.panel-heading.note-toolbar .note-style h3,.note-popover .popover-content .note-style h4,.panel-heading.note-toolbar .note-style h4,.note-popover .popover-content .note-style h5,.panel-heading.note-toolbar .note-style h5,.note-popover .popover-content .note-style h6,.panel-heading.note-toolbar .note-style h6,.note-popover .popover-content .note-style blockquote,.panel-heading.note-toolbar .note-style blockquote{margin:0}.note-popover .popover-content .note-color .dropdown-toggle,.panel-heading.note-toolbar .note-color .dropdown-toggle{width:20px;padding-left:5px}.note-popover .popover-content .note-color .dropdown-menu,.panel-heading.note-toolbar .note-color .dropdown-menu{min-width:340px}.note-popover .popover-content .note-color .dropdown-menu .btn-group,.panel-heading.note-toolbar .note-color .dropdown-menu .btn-group{margin:0}.note-popover .popover-content .note-color .dropdown-menu .btn-group:first-child,.panel-heading.note-toolbar .note-color .dropdown-menu .btn-group:first-child{margin:0 5px}.note-popover .popover-content .note-color .dropdown-menu .btn-group .note-palette-title,.panel-heading.note-toolbar .note-color .dropdown-menu .btn-group .note-palette-title{margin:2px 7px;font-size:12px;text-align:center;border-bottom:1px solid #eee}.note-popover .popover-content .note-color .dropdown-menu .btn-group .note-color-reset,.panel-heading.note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset{width:100%;padding:0 3px;margin:3px;font-size:11px;cursor:pointer;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.note-popover .popover-content .note-color .dropdown-menu .btn-group .note-color-row,.panel-heading.note-toolbar .note-color .dropdown-menu .btn-group .note-color-row{height:20px}.note-popover .popover-content .note-color .dropdown-menu .btn-group .note-color-reset:hover,.panel-heading.note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset:hover{background:#eee}.note-popover .popover-content .note-para .dropdown-menu,.panel-heading.note-toolbar .note-para .dropdown-menu{min-width:216px;padding:5px}.note-popover .popover-content .note-para .dropdown-menu>div:first-child,.panel-heading.note-toolbar .note-para .dropdown-menu>div:first-child{margin-right:5px}.note-popover .popover-content .dropdown-menu,.panel-heading.note-toolbar .dropdown-menu{min-width:90px}.note-popover .popover-content .dropdown-menu.right,.panel-heading.note-toolbar .dropdown-menu.right{right:0;left:auto}.note-popover .popover-content .dropdown-menu.right::before,.panel-heading.note-toolbar .dropdown-menu.right::before{right:9px;left:auto!important}.note-popover .popover-content .dropdown-menu.right::after,.panel-heading.note-toolbar .dropdown-menu.right::after{right:10px;left:auto!important}.note-popover .popover-content .dropdown-menu.note-check li a i,.panel-heading.note-toolbar .dropdown-menu.note-check li a i{color:deepskyblue;visibility:hidden}.note-popover .popover-content .dropdown-menu.note-check li a.checked i,.panel-heading.note-toolbar .dropdown-menu.note-check li a.checked i{visibility:visible}.note-popover .popover-content .note-fontsize-10,.panel-heading.note-toolbar .note-fontsize-10{font-size:10px}.note-popover .popover-content .note-color-palette,.panel-heading.note-toolbar .note-color-palette{line-height:1}.note-popover .popover-content .note-color-palette div .note-color-btn,.panel-heading.note-toolbar .note-color-palette div .note-color-btn{width:20px;height:20px;padding:0;margin:0;border:1px solid #fff}.note-popover .popover-content .note-color-palette div .note-color-btn:hover,.panel-heading.note-toolbar .note-color-palette div .note-color-btn:hover{border:1px solid #000}.note-dialog>div{display:none}.note-dialog .form-group{margin-right:0;margin-left:0}.note-dialog .note-modal-form{margin:0}.note-dialog .note-image-dialog .note-dropzone{min-height:100px;margin-bottom:10px;font-size:30px;line-height:4;color:lightgray;text-align:center;border:4px dashed lightgray}#-moz-document url-prefix(){.note-image-input{height:auto}}.note-placeholder{position:absolute;display:none;color:gray}.note-handle .note-control-selection{position:absolute;display:none;border:1px solid black}.note-handle .note-control-selection>div{position:absolute}.note-handle .note-control-selection .note-control-selection-bg{width:100%;height:100%;background-color:black;-webkit-opacity:.3;-khtml-opacity:.3;-moz-opacity:.3;opacity:.3;-ms-filter:alpha(opacity=30);filter:alpha(opacity=30)}.note-handle .note-control-selection .note-control-handle{width:7px;height:7px;border:1px solid black}.note-handle .note-control-selection .note-control-holder{width:7px;height:7px;border:1px solid black}.note-handle .note-control-selection .note-control-sizing{width:7px;height:7px;background-color:white;border:1px solid black}.note-handle .note-control-selection .note-control-nw{top:-5px;left:-5px;border-right:0;border-bottom:0}.note-handle .note-control-selection .note-control-ne{top:-5px;right:-5px;border-bottom:0;border-left:none}.note-handle .note-control-selection .note-control-sw{bottom:-5px;left:-5px;border-top:0;border-right:0}.note-handle .note-control-selection .note-control-se{right:-5px;bottom:-5px;cursor:se-resize}.note-handle .note-control-selection .note-control-se.note-control-holder{cursor:default;border-top:0;border-left:none}.note-handle .note-control-selection .note-control-selection-info{right:0;bottom:0;padding:5px;margin:5px;font-size:12px;color:white;background-color:black;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-opacity:.7;-khtml-opacity:.7;-moz-opacity:.7;opacity:.7;-ms-filter:alpha(opacity=70);filter:alpha(opacity=70)}.note-hint-popover{min-width:100px;padding:2px}.note-hint-popover .popover-content{max-height:150px;padding:3px;overflow:auto}.note-hint-popover .popover-content .note-hint-group .note-hint-item{display:block!important;padding:3px}.note-hint-popover .popover-content .note-hint-group .note-hint-item.active,.note-hint-popover .popover-content .note-hint-group .note-hint-item:hover{display:block;clear:both;font-weight:400;line-height:1.4;color:white;text-decoration:none;white-space:nowrap;cursor:pointer;background-color:#428bca;outline:0}
<div class="summernote-wrapper msg_box" ng-init="initializeSummernote()">
<textarea name="text" class="summernoteWYSWIG" id="contents" ng-model="message" ng-keyup="createMessage()" title="Contents"></textarea>
</div>
I'm using summernote-0.8.3 version.
summernote('code') is not pulling the data from the editor.Please help me in resolving this issue.
Thanks in Advance.

Write a function like this to decode html
htmlDecode(str){
var div = document.createElement("div");
div.innerHTML = str;
return div.textContent || div.innerText;
}
Then pull the data using the code like below...
htmlDecode($('.summernote').summernote('code'));

Related

label focus not working when the input is non required and if i am using [required] css its working but return initial place

can anyone help me? in below that is my code, in that label focus not working when the phone number input field without required. if am using [required] in css its working when i click the input the label going top but its again returns down to the initial value and the label overlapping the given input
Document
#welcome-form {
flex-direction: column;
position: absolute;
height: 220px;
width: 100%;
background-color: white;
border-top-left-radius: 200px 102px;
bottom: 48px;
}
.welcome-form-item {
position: relative;
border-bottom: 2px solid #adadad;
margin: 20px 0;
width: 80%;
margin-left: 50px;
width: 80%;
}
.welcome-form-item-textbox {
width: 100%;
padding: 0 5px;
height: 40px;
font-size: 16px;
border: none;
background: none;
outline: none;
}
.welcome-form-item label {
position: absolute;
top: 50%;
left: 5px;
transform: translateY(-50%);
font-size: 16px;
pointer-events: none;
transition: .5s;
}
.welcome-form-item span::before {
content: '';
background-color: #303041;
position: absolute;
top: 40px;
left: 0;
width: 0%;
height: 2px;
transition: .5s;
}
.welcome-form-item-textbox:focus\~label,
.welcome-form-item-textbox\[required\]:valid\~label {
top: -5px;
color: #adadad;
}
.welcome-form-item-textbox:focus\~span::before,
.welcome-form-item-textbox\[required\]:valid\~span::before {
width: 100%;
}
#welcome-form-item-button {
color: #ffffff;
vertical-align: bottom;
border: 0;
box-shadow: 0 2px 5px 0 rgb(0 0 0 / 20%), 0 2px 10px 0 rgb(0 0 0 / 10%);
font-weight: bold;
font-size: .75rem;
line-height: 2;
border-radius: 2px 60px;
display: block;
width: 80%;
cursor: pointer;
transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
font-size: 19px;
margin-left: 50px;
margin-top: 20px;
text-spacing: .5;
}
#welcome-form-item-button:hover {
background-color: #303041;
box-shadow: 0 4px 10px 0 rgb(0 0 0 / 20%), 0 4px 20px 0 rgb(0 0 0 / 10%);
}
<div class="welcome-form-item">
<input class="welcome-form-item-textbox" type="text" id="name" name="name" required>
<span></span>
<label for="name">Name</label>
</div>
<div class="welcome-form-item">
<input class="welcome-form-item-textbox" type="text" id="phone_number" name="phone_number">
<span></span>
<label for="phone_number">Phone Number</label>
</div>
<div>
<button id="welcome-form-item-button" type="button">Start
Conversation</button>
</div>
</form>
`this is my output`
enter image description here

d3.js - git branch nodes layout automation with d3

Just found a awesome site Visualizing Git Concepts with D3. the graph is generated by d3.js, but I still not figure out how d3.js to layout the nodes automatically!
for example, one image from that page as below, I just copy the output svg content here, but I would like to know how d3.js automatically put nodes on right location!
/* styles */
body, html {
height: 100%;
}
.intro p, .concept-container p {
padding-top: 10px;
}
a.openswitch {
display: block;
}
a.openswitch.selected {
font-weight: bold;
}
.command-list, .example-list {
margin-top: 10px;
margin-bottom: 10px;
padding: 10px 0;
border-bottom: 2px dashed #888;
border-top: 2px dashed #888;
background-color: #EEE;
}
.command-list a.openswitch {
font-family: Courier New;
}
.concept-area {
padding-bottom: 20px;
}
.concept-container {
display: none;
}
.playground-container {
margin-top: 20px;
position: relative;
}
span.cmd {
background-color: #222222;
color: #FFFFFF;
font-family: Courier New;
padding: 0 0.2em;
}
.svg-container {
margin-left:250px;
display: block;
overflow: auto;
border: 1px dotted #AAA;
}
.svg-container.remote-container {
position: absolute;
top: 0px; right: 0px;
background-color: #EFF1FF;
border-left: 1px dotted #AAA;
border-bottom: 1px dotted #AAA;
}
#ExplainGitZen-Container {
position: absolute;
top: 0; bottom: 0; right: 0; left: 0;
}
#ExplainGitZen-Container .svg-container {
display: inline-block;
border: 1px dotted #AAA;
position: absolute;
top: 0; bottom: 0; right: 0; left: 250px;
margin-left: 0;
}
#ExplainGitZen-Container .svg-container.remote-container {
position: absolute;
top: 0px; right: 0px; left: auto; bottom: auto;
background-color: #EFF1FF;
border-left: 1px dotted #AAA;
border-bottom: 1px dotted #AAA;
}
#ExplainGitZen-Container .playground-container {
position: absolute;
top: 0; bottom: 20px; right: 20px; left: 20px;
}
.remote-name-display {
font-weight: bold;
text-align: right;
}
.control-box {
display: inline-block;
position: absolute;
top: 0px; bottom: 0;
width: 250px;
vertical-align: bottom;
background-color: #000;
border: 1px dotted #AAA;
}
.control-box button {
font-family: Courier New;
font-size: 12px;
margin-right: 5px;
margin-bottom: 5px;
}
.control-box .log {
overflow-y: auto;
position: absolute;
top: 0px; bottom: 20px; left: 0; right: 0;
border-bottom: 1px solid #AAA;
}
.control-box .log,
.control-box input[type="text"] {
font-family: Courier New;
font-size: 14px;
}
.control-box .log .command-entry {
padding-left: 15px;
color: #FFF;
line-height: 14px;
background: url(../images/prompt.gif) no-repeat left center transparent;
}
.control-box input[type="text"] {
position: absolute;
bottom: 0;
padding-left: 15px;
color: #FFF;
line-height: 14px;
background: url(../images/prompt.gif) no-repeat left center transparent;
}
.control-box .log .info,
.control-box .log .error {
font-size: 12px;
padding: 5px;
}
.control-box .log .info {
color: #FFC;
}
.control-box .log .error {
color: #FCC;
}
.control-box input[type="text"] {
width: 235px;
border: none;
}
circle.commit {
fill: #EEEEEE;
stroke: #888888;
stroke-width: 3;
}
circle.commit.checked-out {
fill: #CCFFCC !important;
stroke: #339900;
}
circle.commit.merge-commit {
stroke: #663300;
fill: #FFFFCC;
}
circle.commit.reverted {
fill: #FFC;
stroke: #933;
}
circle.commit.rebased {
stroke: #3300CC;
fill: #CCCCFF;
}
circle.commit.branchless {
fill: #FEFEFE;
stroke: #DDD;
}
.commit-pointer {
stroke: #666;
stroke-width: 4;
}
.merge-pointer {
stroke: #663300;
stroke-width: 4;
}
.commit-pointer.branchless,
.merge-pointer.branchless {
stroke: #DDD;
stroke-width: 2;
}
text.id-label {
text-anchor: middle;
font-family: Courier New;
font-weight: bolder;
fill: #666;
font-size: 10px;
}
text.message-label {
text-anchor: middle;
font-family: Courier New;
fill: #666;
font-size: 10px;
}
g.branch-tag > rect {
fill: #FFCC66;
stroke: #CC9900;
stroke-width: 2;
}
g.branch-tag.git-tag > rect {
fill: #7FC9FF;
stroke: #0026FF;
}
g.branch-tag.remote-branch > rect {
fill: #CCC;
stroke: #888;
}
g.branch-tag > text {
text-anchor: middle;
fill: #000;
font-size: 11px;
font-family: Arial;
}
g.head-tag > rect {
fill: #CCFFCC;
stroke: #339900;
stroke-width: 2;
}
g.head-tag > text {
text-anchor: middle;
fill: #000;
font-size: 11px;
font-family: Arial;
font-weight: bold;
text-transform: uppercase;
}
<svg id="ExplainGitDeleteBranches" height="500" width="657"><text class="remote-name-display" x="10" y="25">Local Repository</text><text class="current-branch-display" x="10" y="45">Current Branch: terran</text><g class="pointers"><line id="ExplainGitDeleteBranches-e137e9b-to-initial" class="commit-pointer" x1="24" y1="300" x2="-8.8" y2="300" marker-end="url(#triangle)"></line><line id="ExplainGitDeleteBranches-bb92e0e-to-e137e9b" class="commit-pointer" x1="114" y1="300" x2="81.2" y2="300" marker-end="url(#triangle)"></line><line id="ExplainGitDeleteBranches-d25ee9b-to-bb92e0e" class="commit-pointer" x1="204" y1="300" x2="171.2" y2="300" marker-end="url(#triangle)"></line><line id="ExplainGitDeleteBranches-071ff28-to-e137e9b" class="commit-pointer" x1="121.61522368914976" y1="228.38477631085024" x2="72.06173157302028" y2="277.93826842697973" marker-end="url(#triangle)"></line><line id="ExplainGitDeleteBranches-f5b32c8-to-bb92e0e" class="commit-pointer" x1="211.61522368914976" y1="228.38477631085024" x2="162.06173157302027" y2="277.93826842697973" marker-end="url(#triangle)"></line><line id="ExplainGitDeleteBranches-e088135-to-f5b32c8" class="commit-pointer" x1="294" y1="210" x2="261.2" y2="210" marker-end="url(#triangle)"></line><line id="ExplainGitDeleteBranches-9e6c322-to-bb92e0e" class="commit-pointer" x1="211.61522368914976" y1="371.6152236891498" x2="162.06173157302027" y2="322.06173157302027" marker-end="url(#triangle)"></line><line id="ExplainGitDeleteBranches-593ae02-to-9e6c322" class="commit-pointer" x1="294" y1="390" x2="261.2" y2="390" marker-end="url(#triangle)"></line></g><g class="commits"><text class="message-label" x="320" y="434"></text><text class="message-label" x="230" y="434"></text><text class="message-label" x="320" y="254"></text><text class="message-label" x="230" y="254"></text><text class="message-label" x="140" y="254"></text><text class="message-label" x="230" y="344"></text><text class="message-label" x="140" y="344"></text><text class="message-label" x="50" y="344"></text><text class="id-label" x="320" y="424">593ae02..</text><text class="id-label" x="230" y="424">9e6c322..</text><text class="id-label" x="320" y="244">e088135..</text><text class="id-label" x="230" y="244">f5b32c8..</text><text class="id-label" x="140" y="244">071ff28..</text><text class="id-label" x="230" y="334">d25ee9b..</text><text class="id-label" x="140" y="334">bb92e0e..</text><text class="id-label" x="50" y="334">e137e9b..</text><circle id="ExplainGitDeleteBranches-e137e9b" class="commit" cx="50" cy="300" r="20"></circle><circle id="ExplainGitDeleteBranches-bb92e0e" class="commit" cx="140" cy="300" r="20"></circle><circle id="ExplainGitDeleteBranches-d25ee9b" class="commit" cx="230" cy="300" r="20"></circle><circle id="ExplainGitDeleteBranches-071ff28" class="commit" cx="140" cy="210" r="20"></circle><circle id="ExplainGitDeleteBranches-f5b32c8" class="commit" cx="230" cy="210" r="20"></circle><circle id="ExplainGitDeleteBranches-e088135" class="commit" cx="320" cy="210" r="20"></circle><circle id="ExplainGitDeleteBranches-9e6c322" class="commit" cx="230" cy="390" r="20"></circle><circle id="ExplainGitDeleteBranches-593ae02" class="commit checked-out" cx="320" cy="390" r="20"></circle></g><g class="tags"><g class="branch-tag"><rect width="46" height="20" y="350" x="207"></rect><text y="364" x="230">master</text></g><g class="branch-tag"><rect width="52" height="20" y="165" x="114"></rect><text y="179" x="140">protoss</text></g><g class="branch-tag"><rect width="34" height="20" y="165" x="303"></rect><text y="179" x="320">zerg</text></g><g class="branch-tag"><rect width="46" height="20" y="440" x="297"></rect><text y="454" x="320">terran</text></g><g class="branch-tag head-tag"><rect width="34" height="20" y="465" x="303"></rect><text y="479" x="320">HEAD</text></g></g></svg>

scss mixins not working error identifier expectedscss

#mixin search-box{
padding: 5px 0px 5px 0px;
border: 2px solid lightseagreen;
width:100%;
outline: none;
border-radius: 5px;
color:$color;
font-family: $myFont;
font-size: 23px;
}
.search-container{
background:lightcyan;
margin: 5px auto;
width:30%;
#include: search-box;
}
Here I am using mixins in scss.
But it is giving me error identifier expectedscss(css-identifierexpected)
Please have a look.
#include is used like
#include <name>
So your styles would look like
#mixin search-box {
padding: 5px 0px 5px 0px;
border: 2px solid lightseagreen;
width: 100%;
outline: none;
border-radius: 5px;
color: $color;
font-family: $myFont;
font-size: 23px;
}
.search-container {
background: lightcyan;
margin: 5px auto;
width: 30%;
#include search-box;
}

Add an overlay image over the top of a responsive image

So here is what I have:
HTML
<div class="frame-container">
<img src="http://placehold.it/400x600" id="image" alt="test" />
<div class="overlay"></div>
</div>
<button id="button">Add Overlay</button>
CSS
.frame-container{
padding: 15%;
background-color: #333333;
-webkit-box-shadow: 4px 6px 5px -1px rgba(120,120,120,0.75);
-moz-box-shadow: 4px 6px 5px -1px rgba(120,120,120,0.75);
box-shadow: 4px 6px 5px -1px rgba(120,120,120,0.75);
}
#image {
width:100%;
overflow: hidden;
}
.frame-holder{
border: 4em #000000 solid;
}
.overlay{
width:100%;
height:100%;
background-color:fff;
background-image: url('http://placehold.it/400x600&text=woo!');
background-size:cover;
z-index:9999;
display:hidden;
}
JS
<script>
$('#button').click(function(){
$('.overlay').css( "display", 'inline'; );
});
</script>
https://jsfiddle.net/vwvu5ee8/7/
All I want to be able to do is click the button and it add the overlay image over the top of the current image.
I've tried all sorts but have started to run out of ideas. I'm sure there is an easy answer from this position.
Try using display:none and display:block instead of display:hidden. There was also an issue with your z-index stacking.
HTML
<div class="frame-container">
<div class="overlay"></div>
<img src="http://placehold.it/400x600&text=Image" id="image" alt="test" />
</div>
<button id="addOverlay">Add Overlay</button>
CSS
.frame-container{
padding: 15%;
background-color: #333333;
position:relative;
-webkit-box-shadow: 4px 6px 5px -1px rgba(120,120,120,0.75);
-moz-box-shadow: 4px 6px 5px -1px rgba(120,120,120,0.75);
box-shadow: 4px 6px 5px -1px rgba(120,120,120,0.75);
}
#image {
width:100%;
overflow: hidden;
position:relative;
z-index:10;
}
.overlay{
width:70%;
height:70%;
position:absolute;
background-color:fff;
background-image: url('http://placehold.it/400x600&text=Overlay');
background-size:cover;
z-index:100;
display:none;
}
JS
$('#addOverlay').click(function(e){
$('.overlay').css('display','block');
});
Here's the demo. And an alternate version using 2 images instead of a background image.

How to make a span put a newline for overflowing text

I'm trying to use the example here:
http://jsfiddle.net/UNs9J/1/
HTML:
<p>Hover here<span>some text here ?</span></p>
CSS:
span{
background:#F8F8F8;
border: 5px solid #DFDFDF;
color: #717171;
font-size: 13px;
height: 30px;
letter-spacing: 1px;
line-height: 30px;
position: relative;
text-align: center;
text-transform: uppercase;
top: -80px;
left:-30px;
display:none;
padding:0 20px;
}
span:after{
content:'';
position:absolute;
bottom:-10px;
width:10px;
height:10px;
border-bottom:5px solid #dfdfdf;
border-right:5px solid #dfdfdf;
background:#f8f8f8;
left:50%;
margin-left:-10px;
-moz-transform:rotate(45deg);
-webkit-transform:rotate(45deg);
transform:rotate(45deg);
}
p{
margin:100px;
float:left;
position:relative;
cursor:pointer;
}
p:hover span{
display:block;
}
So, my problem is, when the text is too long, how do I get it to put the overflowing part in a new line?
Just change
span{
background:#F8F8F8;
border: 5px solid #DFDFDF;
color: #717171;
font-size: 13px;
height: 30px;
letter-spacing: 1px;
line-height: 30px;
position: relative;
text-align: center;
text-transform: uppercase;
top: -80px;
left:-30px;
display:none;
padding:0 20px;
}
to
span{
background:#F8F8F8;
border: 5px solid #DFDFDF;
color: #717171;
font-size: 13px;
height: auto;
letter-spacing: 1px;
line-height: 30px;
position: relative;
text-align: center;
text-transform: uppercase;
top: -80px;
left:-30px;
display:none;
padding:0 20px;
}
then you probably have to adjust the top-attribute to your needs.

Resources