Tuesday 15 April 2014

javascript - Clicking jQuery toggle link moves div content down until scrolling. How do I fix? -



javascript - Clicking jQuery toggle link moves div content down until scrolling. How do I fix? -

as title says, have link @ top of page switches 1 div using jquery toggle. whenever click link since adding floated divs display graphs on right side of page, moves content downwards until scroll mouse. how prepare this? here relevant code:

here css:

<style> div#percents { margin: 0; top: 0; } div#nvalues { margin: 0; top: 0; } div#one { top: 0; float:left; width:50%; overflow:hidden; } div#two { top: 0; float:left; width:50%; overflow:hidden; } </style>

here code:

echo '<div id="percents">'; echo '<div id="one">'; echo '<b><a onclick="togglenvalues();" alt="show n values" style="text-decoration: underline;color: blue;">click show numbers</a></b><br /><br />'; $tw3 = new tablewriter('retention_retreat_vw', 'value', false, false); $tw3->setcolumns('cohort_year', array('cohort_year', array('2006', '2007', '2008','2009', '2010', '2011', '2012'))); $tw3->setcategory('var_name'); $tw3->setpercents(array(1,2,3,4,5,6,7,'averages')); $tw3->writecolumntable('cohort_year', '(ret_1 / cohort * 100)', array('cohort_type', 'first-time freshman'), false, 'averages', 'side', 'one-year first-time freshmen retention rates', false, 'var_name = "overall" - desc', 'var_name-asc', false, 'value-asc'); echo '<p class="citation">notes: efc=expected family contribution. part categories mutually exclusive.</p>'; echo '<p class="citation">includes both full-time , part-time first-time freshman.</p>'; echo '<p class="citation">n/a values represent info not yet available or because cohort in question has no students.</p>'; echo '<p class="citation">only students persist in same major had @ entry counted beingness retained in declared majors category.</p>'; echo '<p class="citation">those did not pass remediation automatically dis-enrolled (co policy) , not retained.</p><br><br>'; echo '</div>'; echo '<div id="two">'; echo '<br><br><br><br><img src="./img/testimage.jpg" />'; echo '<br><br><br><br><img src="./img/testimage2.jpg" />'; echo '<br><br><br><br><img src="./img/testimage3.jpg" />'; echo '</div></div><br style="clear:both"/>'; echo '<div id="nvalues">'; echo '<div id="one">'; echo '<b><a onclick="togglenvalues();" alt="show n values" style="text-decoration: underline;color: blue;">click show percents</a></b><br /><br />'; $tw3 = new tablewriter('retention_retreat_vw', 'value', false, false); $tw3->setcolumns('cohort_year', array('cohort_year', array('2006', '2007', '2008','2009', '2010', '2011', '2012'))); $tw3->setcategory('var_name'); $tw3->writecolumntable('cohort_year', '(ret_1)', array('cohort_type', 'first-time freshman'), false, 'averages', 'side', 'one-year first-time freshmen retention rates', false, 'var_name = "overall" - desc', 'var_name-asc', false, 'value-asc'); echo '<p class="citation">notes: efc=expected family contribution. part categories mutually exclusive.</p>'; echo '<p class="citation">n/a values represent info not yet available or because cohort in question has no students.</p>'; echo '<p class="citation">only students persist in same major had @ entry counted beingness retained in declared majors category.</p>'; echo '<p class="citation">note: includes both full-time , part-time first-time freshman.</p>'; echo '<p class="citation">those did not pass remediation automatically dis-enrolled (co policy) , not retained.</p><br><br>'; echo '</div>'; echo '<div id="two">'; echo '<br><br><br><br><img src="./img/testimage.jpg" />'; echo '<br><br><br><br><img src="./img/testimage2.jpg" />'; echo '<br><br><br><br><img src="./img/testimage3.jpg" />'; echo '</div></div><br style="clear:both"/>';

javascript jquery html css toggle

No comments:

Post a Comment