litFiler.Text += [a class='group2' href='./references/big/'][img src=\"./references/small/" + item.FileName + "\" width=\"100\" /][/a][br /]";
WHERE TO PUT A '+ item.FileName' on the a class 'group2', such as it is on :
[img src=\"./references/small/" + item.FileName + "\" width=\"100\" /]
i can figure where to put it, my colorbox will open the big pictures when i click them, right know the url on hover the small picture is "references/big/"
Related
I'm working on a small app where the user move the background with his mouse or his finger on the screen.
You can find a demo here: http://kaleidoscope-experiment.herokuapp.com/
The background-position is defined by the position of the cursor/finger using this kind of code:
// mobile
position = e.touches[0].pageX + 'px ' + e.touches[0].pageY + 'px';
// desktop
position = e.pageX + 'px ' + e.pageY + 'px';
However, I have significant lags on mobile and tablet and the background is "clipping".
Do you know if there is any alternative to background-position (transform?), to move the background based on the cursor/mouse position?
If you want to roll your own just use a combination of the jQuery mousemove function in combination with CSS3 transforms. Something along the lines of this:
$( "#target" ).mousemove(function( event ) {
var msg = "Handler for .mousemove() called at ";
msg += event.pageX + ", " + event.pageY;
console.log( "<div>" + msg + "</div>" );
$("#movingobject").css('transform', 'translate(' + event.pageY /4 + 'px,' + -event.pageX /4+ 'px)');
});
Here is the reference fiddle that i got from stackoverflow
http://jsfiddle.net/ZmZhw/
There are number of js plugin that are available which will give u some smooth transition and performance also.
I have some tag clouds placed within a div. For each tag cloud there is a thumbs down icon and I used sliding tag css from http://www.cssflow.com/snippets/sliding-tags
If a tag cloud is greater than 80px, it does not fit inside that div. I used word wrap and also fittext plugin from jquery but I could not manage to make it work. Could you suggest what could be the possible solution for it?
I have created fiddle for it: http://jsfiddle.net/aexqoe8n/1/
In Js side :
resultDiv = document.getElementById('tokenCloudResultDiv');
resultDiv.innerHTML = '';
resultDiv .innerHTML="<ul class='tags blue' style='list-style-type: none;padding:5px;'>";
for (i in json) {
addToken(resultDiv, i, json[i]);
}
resultDiv.innerHTML=resultDiv.innerHTML+"</ul>";
function addToken(target, key, result) {
var str;
var weight;
if(result['tagWeight']>80)
$("#tokenCloudResultDiv").fitText(1.2);
weight= "style='font-size: " + result['tagWeight'] + "px;'";
if(addedAutomatically)
str = "<li><div><a " + weight + " >" + result['tagName'] +"</a><span class='thumbsDownIcon' id ='" + tagId + "' style='display:block;cursor:pointer;' ></span></div></li>";
target.innerHTML += str;
}
Hi all i have one problem in list box in which i would like to bind image with data on condition . Like when user is active i like to display different image , when he is not working like to display different image . this time i am displaying name in different color on his status like not working then in Red color, working with green color.
My html is
<asp:ListBox ID="ddlDriver" Width="100%" AutoPostBack="true" OnSelectedIndexChanged="ddlDriver_SelectedIndexChanged"
runat="server" BackColor="White" Height="380px">
</asp:ListBox>
Code :
if (_driv.DriverStatus == 1)
{
ddlDriver.Items[i].Text = ddlDriver.Items[i].Value + "-" + ddlDriver.Items[i].Text + " " + OrderTota;
ddlDriver.Items[i].Attributes.CssStyle.Add(HtmlTextWriterStyle.Color, "red");
}
else if (_driv.DriverStatus == 2)
{
ddlDriver.Items[i].Text = ddlDriver.Items[i].Value + "-" + ddlDriver.Items[i].Text + " " + OrderTota;
ddlDriver.Items[i].Attributes.CssStyle.Add(HtmlTextWriterStyle.Color, "green");
}
please help me about this issue.
You may define two css classes with appropriate background-image property and conditionally set class on items in code-behind
I am trying to create an infoWindow in google maps v3 which contains multiple lines of content. However the "\n" I am using to insert a newline doesn't seem to work. What is the recommended way to insert a newline?
see code:
//set content of infoWindow
window.setContent(inspStates[i].name+ "\n"+"total: "+inspStates[i].totalInsp+ "\n"+ info);
The easiest thing to do it wrap the content in a div or in a p and then use <br /> for line breaks.
So something like
//set content of infoWindow
window.setContent("<p>" + inspStates[i].name + "<br />" +
"total: " + inspStates[i].totalInsp + "<br />" + info +
"</p>");
Use HTML for the content, and put each line in its own paragraph. Line separation helps with readability, especially if any of the lines is long enough to wrap.
window.setContent(
"<p>" + inspStates[i].name + "</p>" +
"<p>Total: " + inspStates[i].totalInsp + "</p>" +
"<p>" + info + "</p>");
i want to print some default string value in bold but i am using tag but it is not rendered as bold rather it is showing it is printing the same etc
var defaultFCKValue = '----Original Message---- \n';
defaultFCKValue += '<b>From:</b> ' + from + '\n';
defaultFCKValue += '<b>Sent:</b> ' + date + '\n';
defaultFCKValue += $('div.popupContent div div.message').html();
var oEditor = FCKeditorAPI.GetInstance("<%=FCKeditorSelfDocument.ClientID %>");
var oDOM = oEditor.EditorDocument;
oDOM.body.innerText = defaultFCKValue;
The problem is that the <b> tags are being escaped/encoded and are being rendered as <b>
You might want to try using
oEditor.setHtml(defaultFCKValue)
See the js docmentation for fckeditor.
Try <strong> rather than <b>, as <b> tags have been depreciated in most doctypes. It may not directly solve your problem, but it is at least good practice.