I have a page with tinymce. The text in the tinymce can be with two font colors: green and blue.
The first time the page loads, here's the content of the tinymce textarea:
"<p style="background-color: white; opacity: 1; color: green;">1 line</p>
<p style="background-color: white; opacity: 1; color: blue;">1 line345</p>
<p style="background-color: white; opacity: 1; color: blue;">1 line</p>"
So, the first row is green, and the other lines are blue.
Right after that, I have a method for validation of the lines. All valid lines are colored blue, and the invalid lines are colored green, with this code:
.css("color", "blue")
In this case, all of the lines are valid and are quickly colored blue. I can see them and they are blue.
However, when I execute this line:
$('#myTinymceId').val()
I get the same paragraph as the previous one. The first line is still:
<p style="background-color: white; opacity: 1; color: green;">1 line</p>
even though I can see it's blue. What can I do to get the correct color?
You need another way to access the tinymce editor content. Try
tinymce.get('myTinymceId').getContent();
Related
image http://pasteio.com/m26f642c81452a5bf67cfc5f0b0f2390c
I'm using leaflet to render the mapbox map. There is small triangle on the top of marker; how can I hide it?
For others coming across this post who may be struggling with the tooltip triangle, or even the background css of the tooltip, I have put together my research in one place and found the various ways to affect the triangle and the background of the tooltips and the popups!
If you have a POPUP bound to a marker, .leaflet-popup-tip controls the triangle. Here I am hiding it:
.leaflet-popup-tip {
background: rgba(0, 0, 0, 0) !important;
box-shadow: none !important;
}
If you have a TOOLTIP you have added to the map, you can control the tooltip's triangle with this magical css:
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
border: none !important;
}
More styling:
POPUP: You can also control the popup's css as well by targeting .leaflet-popup-content-wrapper. Here I am completely removing all traces of the background/border/box of the popup & enlarging the font:
.leaflet-popup-content-wrapper {
background: rgba(0, 0, 0, 0) !important;
border: none !important;
font-size: 20px;
box-shadow: none !important;
}
TOOLTIP: You can add a class name to a tooltip when you create it such as {className: 'popup'}, and then use that to style the tooltip:
.popup {
background: rgba(0, 0, 0, 0) !important;
border: none !important;
font-size: 20px;
box-shadow: none !important;
}
To see how to add tooltips and popups to the map, and how all of this works together, here is a working example with commenting throughout:
https://repl.it/#MeowMeow/NeighboringConventionalPhp
Hope this is helpful to someone! :)
This triangle is controlled by the .leaflet-popup-tip class in css. If you are using standard Leaflet, you should be able to hide the tip by adding the following to your css (after leaflet.css is loaded):
.leaflet-popup-tip {
width: 0px;
height: 0px;
}
Mapbox actually creates the tip in a slightly different way from standard Leaflet, by styling the element border rather than the element content, so if you are using mapbox.js, you should be able to do it by adding the following (after mapbox.css is loaded):
.leaflet-popup-tip {
border: 0px;
}
On desktop Webkit, my image displays fine with no problems. When viewing it on mobile Webkit (iPad iOS 5 for example), a glaring white border appears. I am using background-image and background-size because my element has a fixed proportion, but the image source itself can be any random proportion.
JSFiddle:
http://jsfiddle.net/tokyotech/A2zAv/
HTML:
<img />
CSS:
body {
background: #666; }
img {
width: 8em;
height: 8em;
display: block;
background: rgba(0,0,0,0.5);
box-shadow: 0 1px 0 rgba(255,255,255,0.1),
0 1px 0 rgba(0,0,0,0.5) inset;
background-size: cover;
border-radius: 0.4em;
background-image: url(http://1.bp.blogspot.com/_yhfaur8OkQ0/SwQzJkzYt5I/AAAAAAAAAtU/5eIqHFmS63s/s400/ev.jpg);
}
This is a weird issue that happens when you don't specify an img src. The browser wants to show that the element exists but doesn't have any content so it wraps it with a border. You can fix this by declaring the img's source in the HTML.
Try this fiddle: http://jsfiddle.net/A2zAv/3/
If you don't want to declare an img src, don't use the img element for your image. You could use a div and get around this rendering issue instead. This will allow you to contain the image to the container as needed.
http://jsfiddle.net/A2zAv/4/
As a further alternate, you could insert a 1px by 1px transparent spacer gif in your image's src if you absolutely want to use an img tag.
See Strange border on IMG tag for more details.
I am trying to fit my website for iphone
for that i am using twitter bootstrap responsive css
i gave the container with different border colors for different width
but when i minimize the browser window the border colors are not reflecting for the browser window
http://jsfiddle.net/CXkQp/1/
http://jsfiddle.net/CXkQp/1/embedded/result/
#media (min-width: 1200px) {
.row {
margin-left: -30px;
*zoom: 1;
}
.row:before,
.row:after {
display: table;
line-height: 0;
content: "";
}
.row:after {
clear: both;
}
[class*="span"] {
float: left;
min-height: 1px;
margin-left: 30px;
}
.container,
.navbar-static-top .container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: 1170px;
border: 1px solid red;
}
If I understand your question correctly, the page example you posted should be responsive, though I'm not sure that your bootstrap grid is setup the way you need it.
You have nested container divs for one thing # lines 120 and 145
Check what happens if I rename your 2 container divs:
http://jsfiddle.net/panchroma/CXkQp/3/embedded/result/
http://jsfiddle.net/panchroma/CXkQp/3/
line 120
<div class="containerA" style="background-color: white;">
line 145
<div class="containerB">
There are also some validation errors which could possibly be another piece of the puzzle. The cause may be that you can't simply paste HTML head content into the jsFiddle HTML panel as you have done. Check http://doc.jsfiddle.net/use/hacks.html#css-panel-hack for details on what you need to do.
My appologies if I've misunderstood something
Good luck!
I'm using fancybox 2 and I can get rid of the padding around the outside of the frame, but then I lose the border-radius that it comes with.
What I want is a border-radius around the main content inside the frame. So I tried going into the css and adding a border-radius to the fancy-box inner selector and it won't work. How can I give the frame a rounded corner without a border?
If anyone can help me with this that would be great!
Try this code it worked for me
Add custom classes after fancy box on complete method.
Ex.
HTML
Login
JS
$(document).ready(function(e) {
$(".signin-ovr").fancybox({
afterLoad : function(){
$("#fancybox-content").addClass('fancybox-content-cust');
$(".fancybox-bg").addClass('fancybox-bg-cust');
$("#fancybox-outer").addClass('fancybox-outer-cust');
}
});
});
CSS
.fancybox-content-cust {
overflow: visible !important;
border: 10px solid #FFFFFF;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
}
.fancybox-bg-cust{
display: none;
}
.fancybox-outer-cust {
background: transparent !important;
}
Then you will get border radius to the overlay box.
for fancybox v2 round borders
.fancybox-outer, .fancybox-inner, .fancybox-skin {
background: none repeat scroll 0 0 rgba(0, 0, 0, 0);
border-radius: 10px!important;
}
CSS3 has a border radius property ironically enough entitled border-radius there are a few specific variations ie, Firefoxes moz-border-radius.
It is used like so:
#div-id .specific-class {
border-radius: 10px;
}
If you only want one rounded it has the ability to be modified like so
border-top-left-radius:2em;
border-top-right-radius:2em;
border-bottom-right-radius:2em;
border-bottom-left-radius:2em;
I hope this answers your question.
While everyone else loves those rounded corners and asks how to make them, I have to get rid of them for my case. The iPhone renders my HTML elements with rounded corners. Is there any way to prevent this?
The below image shows example controls.
The HTML code is roughly
<input class="text" type="text"/>
<input class="button" type="button"/>
The CSS code is roughly
.text {
border: 1px solid #aabbcc;
height: 2em;
width: 100%;
}
.button {
border: 1px solid #ffffff;
background-color: #385070;
color: #ffffff;
font-weight: bold;
height: 2.2em;
}
input {
-webkit-border-radius: 0;
}
CSS to the rescue! You want the following style:
border-radius:0px;