I want to make a vertical line in my table by using DOM...
I can insert row and cell but do not know how to insert vertical line.
Can anyone help?
You can add <hr> tag in html and css as follows
height: 100%;
width: 100%;
also u can in php code as follows.
<?php
if(true)
{
echo '<hr>';
}
else
{
echo'';
}?>
Related
first of all: GREAT STUFF!!
SITUATION: The image loaded in my slider are smaller than the slides container. Using "$FillMode: 5" I can make sure that images have the right size to display within the slides-container, but they are centered.
Q: Is there a way to have them align to the right, so that i can display the caption to the left of it.
TRIED: using CSS to align the image: neither
#slides img { float: left !important };
nor
#slides img {
position: absolute !important;
right: 0px !important;
}
did the job.
A:
After some fiddling and around analyzing the actual sourcecode generated by the script i found out that
using #slides results in a coding error as the tag "" is duplicated (for whatever reason) and would therefor give 2 identical IDs, so better use ".slides" / ""
the following CSS does the job an aligns a smaller image to the right of the slide
.slides {
div {
img {
right: 0px !important;
left: auto !important;
}
}
Jssor slider will fill and align image (in following format) automatically according to $FillMode,
<img u="image" src="url" />
To fill image manually by your self, please remove u="image",
<img src="url" />
I've been trying to get jQuery to select a particular element in the JQuery zoom plugin but it doesnt seem to be working
This is the html markup for the zoom region
<div class="zoom" style="width: 60% !important; display: block; position: fixed; overflow: hidden;">
<img src="//cdn.shopify.com/s/files/1/0456/6809/t/3/assets/bx_loader.gif?27021" alt="" class="abs-center-translate loader">
<img src="//cdn.shopify.com/s/files/1/0456/6809/products/568A.jpeg?v=1413437903" class="zoomImg" style="position: absolute; top: -1385.54456824513px; left: -389.68108776267px; opacity: 1; width: 682.5px; height: 1024px; border: none; max-width: none; max-height: none;">
</div>
function showZoomImgSmaller(img) {
var zoomsmall = $('.zoom');
zoomsmall.empty();
zoomsmall.append('{{ "bx_loader.gif" | asset_url | img_tag: "", "abs-center-translate loader" }}');
$('.collectionZoomContainer').show();
zoomsmall.attr( "style","width:60%!important" );
var zoomsmallimg= $('.zoom > img');
console.log(zoomsmallimg.next().get());
$('.zoomImg').attr("style","max-width:500px!important");
zoomsmall.show();
zoomsmall.zoom({url: img, magnify: 0.5});
}
The console returns just a [] for the .zoomImg.get() and an undefined for a .zoomImg.html()
I want to change the css of this particular element and can only do it through jquery.
Any help will be greatly appreciated. Thanks
There is a lot going on here that I cannot see, but my guess is that when you call empty() on your div, you are removing all children of the div (including the .zoomImg class which you are trying to look up later). Instead of removing all elements, you might just want to remove the first image:
function showZoomImgSmaller(img) {
var zoomsmall = $('.zoom');
$('.zoom > .loader').remove(); //change is here
zoomsmall.append('{{ "bx_loader.gif" | asset_url | img_tag: "", "abs-center-translate loader" }}'); //angular? not sure what this does
$('.collectionZoomContainer').show(); //not sure what this
zoomsmall.attr( "style","width:60%!important" );
var zoomsmallimg= $('.zoom > img');
console.log(zoomsmallimg.next().get());
$('.zoomImg').attr("style","max-width:500px!important");
zoomsmall.show();
zoomsmall.zoom({url: img, magnify: 0.5});
}
Hey so I managed to get my style applied by appending css in the head of the page. This style was applied even though the element didnt exist till later.
This is the code I used.
$("<style type='text/css'> .zoomImg{ max-width:200px!important;} </style>").appendTo("head");
Cheers.
In Drupal (my one is v. 7), in a search module, the text "search" in search button is viewing by default. Probably the HTML structure behind this thing is like this:
<input type="submit" value="Search" />
I placed an image instead of the default search button image/bg color. I want to delete the value="Search" portion from the HTML <input/> tag.
I went to modules/search, but there is no such file with a <input/> tag. So how come I remove the text?
I got a solution, my so called 'Bangla Shamadhan', from http://mydrupalblog.lhmdesign.com/theming-search-submit-button-css-cross-browser-compatible-solution.
It's the text-indent thing:
#search-block-form input.form-submit, #search-form input.form-submit {
height: 24px;
width: 24px;
cursor: pointer;
text-indent: -9999px;
border: none;
background: url(images/mag_glass.jpg) no-repeat left top;
}
The text is indented for unlimited spaces. It worked for me, but it's not a good practice to me.
So, how can I edit the <input/> tag in a Drupal template or module to remove the attribute value="Search"?**
I think hook_form_alter() is what you need in this case:
function mymodule_form_alter(&$form, $form_state, $form_id) {
if($form_id=='search_form') {
$form['basic']['inline']['submit']['#value'] = ''; // OR
unset($form['basic']['inline']['submit']['#value']);
}
}
I'm using jQuery UI "sortable" plugin to be able to select and sort items.
I set up the plugin to have two lists, one for "available" items, the second for "selected" items.
The plugin works as expected, I can move items from one list to the other.
However, when I remove one item from the list, the height of the list is lowered. Is there any way to fix it?
In fact, i'd like to set the outer border of both list to the initial height of the left items (at the beginning, all items are in the first list)
This picture describe what I want to do:
The red lines are what I'd like. I want both lists to have this size, fixed.
Here is my code (generated from an asp.net webpage actually) :
<script type="text/javascript">
$(function () {
$("#sourceItems").sortable({
connectWith: "#targetItems",
update: function (event, ui) {
$("#selectedUserIDs").val(
$("#targetItems").sortable('toArray')
);
},
placeholder: "ui-state-highlight"
});
$("#targetItems").sortable({
connectWith: "#sourceItems",
placeholder: "ui-state-highlight"
});
$("#sourceItems, #targetItems").disableSelection();
});
</script>
<style type="text/css">
#sourceItems, #targetItems { list-style-type: none; margin: 0; padding: 0; margin-right: 10px; background: #eee; padding: 5px; width: 230px; border:solid 1px black; }
#sourceItems li, #targetItems li { margin: 5px; padding: 5px; width: 200px; height: 12px; }
</style>
<div style="float: left; display: inline-block; width:fill-available">
<p>Available :</p>
<ul id="sourceItems" class="droptrue">
<li class="ui-state-default" id='i1'>item1</li>
<li class="ui-state-default" id='i32'>item2</li>
<li class="ui-state-default" id='i47'>item3</li>
<li class="ui-state-default" id='i46'>item4</li>
</ul>
</div>
<div style="float: left; display: inline-block;">
<p>Selected :</p>
<ul id="targetItems" class="droptrue">
</ul>
</div>
<div style="display: none">
<input name="selectedUserIDs" type="text" id="selectedUserIDs" />
</div>
The hidden input field is my container for storing selected items (posted with the form).
I've tried by adding .height($("#sourceItems).outerHeight()); to both lists, but this does not works.
I came here looking for a similar, but more generalized solution to the same problem. The solution here didn't help me, but I figured it out on my own and thought it might be helpful to share it.
I didn't want the two sortable lists to be fixed, I just wanted them to stay the same height. When you are dealing with a large number of items, having two dynamically sized boxes around the list can make it hard to work with, as the one box is so much smaller than the other. Making both boxes a fixed height is also less than optimal, as then you end up with scrollbars once your number of items in one list exceeds that height. I wanted both boxes to dynamically expand using the built-in functionality of the JQuery sortable, connectWith code, but I also wanted them to both just be set to the larger of the two. To do this I found that you can modify the padding on the lists, and that area will still be an interactable area for purposes of drag-and-drop.
So, to make two connectWith, sortable lists keep the same height, you can add the following handler for the over event:
over: function(event, ui) {
var heightDiff = $("#sourceItems").height() - $("#targetItems").height();
$("#sourceItems").css('padding-bottom', (Math.abs(heightDiff) - heightDiff) / 2 + 'px');
$("#targetItems").css('padding-bottom', (Math.abs(heightDiff) + heightDiff) / 2 + 'px');
}
Here's a fiddler example extending the other example with this event handler: http://jsfiddle.net/TLrn7/
Edit:
$(document).ready(function(){
$("#targetItems").height($("#sourceItems").height());
$("#sourceItems").height($("#sourceItems").height());
});
http://jsfiddle.net/JEY4U/1/
Old Answer:
Use a 'helper' function, which makes sure the dragged elements have proper width and height.
Something like this:
helper: function(event, ui) {
$(ui).width($(ui).width());
$(ui).height($(ui).height());
ui.children().each(function() {
$(this).width($(this).width());
});
return ui;
}
You use it like this:
$(SOME_OBJECT).sortable({
connectWith: ...,
placeholder: ...,
......
helper: function....
});
Of course you can write any costume helper function you'd like.
The jQuery UI list height is set to a specific height using CSS. Example for 300px height.
.ui-autocomplete {
max-height: 300px;
overflow-y: auto;
/* prevent horizontal scrollbar */
overflow-x: hidden;
}
/* IE 6 doesn't support max-height
* we use height instead, but this forces the menu to always be this tall
*/
* html .ui-autocomplete {
height: 300px;
}
Read the documentation here: https://jqueryui.com/autocomplete/#maxheight
I was wondering if it's possible to create a HTML div container with some CSS magic that shows a horizontal scrollbar like the one with the screenshots on the iTunes preview on the web. I want this to work in Safari on the iPhone.
e.g. http://itunes.apple.com/app/super-monkey-ball/id281966695?mt=8
I would like to use that to display thumbnails in an UIWebView on iPhone. I experimented with the overflow css property but didn't get it to work.
Thanks for your replies.
I don't have time to test it right now, but I think something along the lines of the following should work:
ul#container
{
overflow: hidden;
overflow-x: scroll;
width: 500px; /* or whatever */
height: 200px; /* or whatever */
white-space: nowrap;
}
ul#container li
{
display: inline-block;
width: 100px; /* or whatever */
height: 200px; /* or whatever */
}
<ul id="container">
<li>Item One</li>
<li>Item Two</li>
<li>Item three</li>
<li>...<!-- you get the point --></li>
</ul>
You might need to use float: left; on the li elements, but I'm not sure. And it maybe depends on the browser you, or your users, will be using.
I'll check this out when I get home, but for now I offer you a demo at: http://jsbin.com/atuvo
Try this...
We did a nice component that works with jQuery. It's easy to use.
http://api.mutado.com/mobile/mtdtouch/js/
There's is also a demo that works on iPhone and iPad if you want to try it.
Cheers,
Lorenzo
iScroll is pretty awesome too, it does nice horizontal momentum scrolling: http://cubiq.org/iscroll
You can take it here http://appradar.ru/
<script src="http://appradar.ru/wp-content/themes/appradar/js/jquery.horizontal.scroll.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var w = 0, h = 0;
$('#slider div').each(function(i, index){
w += $(this).outerWidth();
h = $(this).outerHeight() > h ? $(this).outerHeight() : h;
});
$('#slider').width(w).height(h);
$('#slider-outer').height(h + 8).horizontalScroll();
});
</script>